summaryrefslogtreecommitdiffstats
path: root/src/sp-namedview.cpp
diff options
context:
space:
mode:
authorBryce Harrington <bryce@bryceharrington.org>2006-12-31 22:50:51 +0000
committerbryce <bryce@users.sourceforge.net>2006-12-31 22:50:51 +0000
commit34ef6ae3257188d20d939d8cdbb8cb40ffec82bd (patch)
tree9ceaa51c95fa017dd8da62d134519cbb104e0a33 /src/sp-namedview.cpp
parentFix 1516933 (text stroke crash inkscape) (diff)
downloadinkscape-34ef6ae3257188d20d939d8cdbb8cb40ffec82bd.tar.gz
inkscape-34ef6ae3257188d20d939d8cdbb8cb40ffec82bd.zip
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)
Diffstat (limited to 'src/sp-namedview.cpp')
-rw-r--r--src/sp-namedview.cpp7
1 files changed, 6 insertions, 1 deletions
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<SPCanvasItem*>(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);