From 6053d8da0619d0da92005ba52b47353ca361addb Mon Sep 17 00:00:00 2001 From: cilix42 Date: Mon, 18 Aug 2008 00:48:08 +0000 Subject: [PATCH] Check whether we are really in LPEToolContext in sp_lpetool_toolbox_sel_changed() --- src/widgets/toolbox.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 90551160f..4bd645158 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -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); -- 2.30.2