Code

Check whether we are really in LPEToolContext in sp_lpetool_toolbox_sel_changed()
authorcilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:48:08 +0000 (00:48 +0000)
committercilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:48:08 +0000 (00:48 +0000)
src/widgets/toolbox.cpp

index 90551160fc3cbeab15b2765c70b1c0a0e7899128..4bd645158864b2fdc1f0d6411d9cd4f08269b050 100644 (file)
@@ -4840,7 +4840,10 @@ sp_lpetool_toolbox_sel_changed(Inkscape::Selection *selection, GObject *tbl)
     {
         GtkAction* w = GTK_ACTION(g_object_get_data(tbl, "lpetool_line_segment_action"));
         SPItem *item = selection->singleItem();
-        SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(selection->desktop()->event_context);
+        SPEventContext *ec = selection->desktop()->event_context;
+        if (!SP_IS_LPETOOL_CONTEXT(ec))
+            return;
+        SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(ec);
         if (item && SP_IS_LPE_ITEM(item) && lpetool_item_has_construction(lc, item)) {
             SPLPEItem *lpeitem = SP_LPE_ITEM(item);
             Effect* lpe = sp_lpe_item_get_current_lpe(lpeitem);