Code

fix crash when ungrouping lpe paths
authorbuliabyak <buliabyak@users.sourceforge.net>
Thu, 12 Jun 2008 18:11:49 +0000 (18:11 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Thu, 12 Jun 2008 18:11:49 +0000 (18:11 +0000)
src/sp-item.cpp

index 0784d404c39745243c71be65fd5e4f90c95c7014..8fa93427822a3c55b9175aa36c951c900158f1b6 100644 (file)
@@ -1299,14 +1299,16 @@ sp_item_adjust_livepatheffect (SPItem *item, NR::Matrix const &postmul, bool set
             // If the path effect is used by 2 or more items, fork it
             // so that each object has its own independent copy of the effect
             LivePathEffectObject *lpeobj = (*it)->lpeobject;
-            LivePathEffectObject *new_lpeobj = lpeobj->fork_private_if_necessary();
-            if (new_lpeobj != lpeobj) {
-                sp_lpe_item_replace_path_effect(lpeitem, lpeobj, new_lpeobj);
-            }
+            if (lpeobj) {
+                LivePathEffectObject *new_lpeobj = lpeobj->fork_private_if_necessary();
+                if (new_lpeobj != lpeobj) {
+                    sp_lpe_item_replace_path_effect(lpeitem, lpeobj, new_lpeobj);
+                }
         
-            if (lpeobj->lpe) {
-                Inkscape::LivePathEffect::Effect * effect = lpeobj->lpe;
-                effect->transform_multiply(to_2geom(postmul), set);
+                if (lpeobj->lpe) {
+                    Inkscape::LivePathEffect::Effect * effect = lpeobj->lpe;
+                    effect->transform_multiply(to_2geom(postmul), set);
+                }
             }
         }
     }