From: johanengelen Date: Tue, 4 Dec 2007 23:53:07 +0000 (+0000) Subject: don't crash upon adding strange named XML element to namedview. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ffa664d692f205aefee066c2c4ea020765c55a51;p=inkscape.git don't crash upon adding strange named XML element to namedview. --- 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;