From 1847cc86d6aae9586afa4b2a82cd3aab35e5f967 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 9 Mar 2009 00:31:01 +0000 Subject: [PATCH] fix crash when duplicating an orphaned clone --- src/selection-chemistry.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index badf27ecb..f393f73f9 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -291,6 +291,8 @@ void sp_selection_duplicate(SPDesktop *desktop, bool suppressDone) SPObject *old_clone = doc->getObjectById(id); if (SP_IS_USE(old_clone)) { SPItem *orig = sp_use_get_original(SP_USE(old_clone)); + if (!orig) // orphaned + continue; for(unsigned int j = 0; j < old_ids.size(); j++) { if (!strcmp(SP_OBJECT_ID(orig), old_ids[j])) { // we have both orig and clone in selection, relink -- 2.30.2