From: Adonis Papaderos Date: Thu, 25 Nov 2010 10:48:07 +0000 (+0200) Subject: Fix Bug #675309 - crash when unlinking an orphaned clone X-Git-Url: https://git.tokkee.org/?p=inkscape.git;a=commitdiff_plain;h=6c572dd450c636a069b4d513f1b85742c1afb9fd Fix Bug #675309 - crash when unlinking an orphaned clone --- diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 61db7f961..6786479d6 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2150,6 +2150,11 @@ sp_selection_unlink(SPDesktop *desktop) SPItem *unlink; if (SP_IS_USE(item)) { unlink = sp_use_unlink(SP_USE(item)); + // Unable to unlink use (external or invalid href?) + if (!unlink) { + new_select = g_slist_prepend(new_select, item); + continue; + } } else /*if (SP_IS_TREF(use))*/ { unlink = SP_ITEM(sp_tref_convert_to_tspan(item)); } diff --git a/src/sp-use.cpp b/src/sp-use.cpp index 9cd38e4b3..ecb7eb788 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -678,7 +678,7 @@ sp_use_unlink(SPUse *use) // Track the ultimate source of a chain of uses. SPItem *orig = sp_use_root(use); - g_return_val_if_fail(orig, NULL); + if (!orig) return NULL ; // Calculate the accumulated transform, starting from the original. Geom::Matrix t = sp_use_get_root_transform(use);