Code

check if item is LPEItem before casting!!! should fix bug 236788
authorjohanengelen <johanengelen@users.sourceforge.net>
Mon, 2 Jun 2008 19:53:18 +0000 (19:53 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Mon, 2 Jun 2008 19:53:18 +0000 (19:53 +0000)
src/object-edit.cpp

index ecd6227f42cc781088b11d48e13a978098ba230b..dedcfdabf20e2051576d6b433a4d5fc946217efd 100644 (file)
@@ -76,9 +76,11 @@ static SPKnotHolder *sp_lpe_knot_holder(SPItem *item, SPDesktop *desktop)
 SPKnotHolder *
 sp_item_knot_holder(SPItem *item, SPDesktop *desktop)
 {
-    if (sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item)) &&
-        sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item))->isVisible() &&
-        sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item))->providesKnotholder()) {
+    if ( SP_IS_LPE_ITEM(item) &&
+         sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item)) &&
+         sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item))->isVisible() &&
+         sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item))->providesKnotholder() )
+    {
         return sp_lpe_knot_holder(item, desktop);
     } else if (SP_IS_RECT(item)) {
         return sp_rect_knot_holder(item, desktop);