From ffa664d692f205aefee066c2c4ea020765c55a51 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Tue, 4 Dec 2007 23:53:07 +0000 Subject: [PATCH] don't crash upon adding strange named XML element to namedview. --- src/sp-namedview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 03cc4bdad..a26d1ce0e 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -513,9 +513,10 @@ static void sp_namedview_child_added(SPObject *object, Inkscape::XML::Node *chil const gchar *id = child->attribute("id"); if (!strcmp(child->name(), "inkscape:grid")) { sp_namedview_add_grid(nv, child, NULL); - } else { + } else if (id) { SPObject *no = object->document->getObjectById(id); - g_assert(SP_IS_OBJECT(no)); + if ( !SP_IS_OBJECT(no) ) + return; if (SP_IS_GUIDE(no)) { SPGuide *g = (SPGuide *) no; -- 2.30.2