From: rwst Date: Tue, 14 Feb 2006 09:59:53 +0000 (+0000) Subject: check for null spitem (fix for #1122875, patch by inkblotter) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a22896befb8a2c1fa5fe56ee0b60969c03c81f54;p=inkscape.git check for null spitem (fix for #1122875, patch by inkblotter) --- diff --git a/src/svg-view.cpp b/src/svg-view.cpp index 6d408e79c..5da24df98 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -135,7 +135,7 @@ arena_handler (SPCanvasArena *arena, NRArenaItem *ai, GdkEvent *event, SPSVGView static gboolean active = FALSE; SPEvent spev; - SPItem *spitem = (ai) ? (SPItem*)NR_ARENA_ITEM_GET_DATA (ai) : NULL; + SPItem *spitem = (ai) ? (SPItem*)NR_ARENA_ITEM_GET_DATA (ai) : 0; switch (event->type) { case GDK_BUTTON_PRESS: @@ -147,10 +147,14 @@ arena_handler (SPCanvasArena *arena, NRArenaItem *ai, GdkEvent *event, SPSVGView break; case GDK_BUTTON_RELEASE: if (event->button.button == 1) { - if (active && (event->button.x == x) && (event->button.y == y)) { + if (active && (event->button.x == x) && + (event->button.y == y)) { spev.type = SP_EVENT_ACTIVATE; - sp_item_event (spitem, &spev); - } + if ( spitem != 0 ) + { + sp_item_event (spitem, &spev); + } + } } active = FALSE; break; @@ -160,12 +164,18 @@ arena_handler (SPCanvasArena *arena, NRArenaItem *ai, GdkEvent *event, SPSVGView case GDK_ENTER_NOTIFY: spev.type = SP_EVENT_MOUSEOVER; spev.data = svgview; - sp_item_event (spitem, &spev); + if ( spitem != 0 ) + { + sp_item_event (spitem, &spev); + } break; case GDK_LEAVE_NOTIFY: spev.type = SP_EVENT_MOUSEOUT; spev.data = svgview; - sp_item_event (spitem, &spev); + if ( spitem != 0 ) + { + sp_item_event (spitem, &spev); + } break; default: break;