From 34ef6ae3257188d20d939d8cdbb8cb40ffec82bd Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Sun, 31 Dec 2006 22:50:51 +0000 Subject: Bugfix for 1625278, where inkscape would crash if loading a recent document from a fresh inkscape instance, that triggers a null pointer situation in sp-namedview. The code in question deals with gridviews, so I suspect it has something to do with grid settings. In any case, this commit prevents the null pointer situation and stops the crash. (bzr r2113) --- src/sp-namedview.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sp-namedview.cpp') diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index a85577826..d3792133b 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -768,7 +768,12 @@ void SPNamedView::hide(SPDesktop const *desktop) GSList *l; for (l = gridviews; l != NULL; l = l->next) { - if (SP_CANVAS_ITEM(l->data)->canvas == sp_desktop_canvas(desktop)) { + if (! l->data) { + continue; + } + SPCanvasItem *item = static_cast(l->data); + + if (item->canvas == sp_desktop_canvas(desktop)) { sp_canvas_item_hide(SP_CANVAS_ITEM(l->data)); gtk_object_unref(GTK_OBJECT(l->data)); gridviews = g_slist_remove(gridviews, l->data); -- cgit v1.2.3