Code

a couple more checks just in case
authorbuliabyak <buliabyak@users.sourceforge.net>
Wed, 27 Jun 2007 20:26:29 +0000 (20:26 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Wed, 27 Jun 2007 20:26:29 +0000 (20:26 +0000)
src/style.cpp

index 699d950541e723858dc4d5cfc0f44c2e5da1b3ef..fbd472129516c0750cb2dab0d664e2ecc62988a2 100644 (file)
@@ -2165,11 +2165,13 @@ sp_style_merge_ifilter(SPStyle *style, SPIFilter const *parent)
     if (style->filter.href && style->filter.href->getObject())
        style->filter.href->detach();
 
-    try {
-        style->filter.href->attach(*parent->href->getURI());
-    } catch (Inkscape::BadURIException &e) {
-        g_warning("%s", e.what());
-        style->filter.href->detach();
+    if (style->filter.href && parent->href) {
+        try {
+            style->filter.href->attach(*parent->href->getURI());
+        } catch (Inkscape::BadURIException &e) {
+            g_warning("%s", e.what());
+            style->filter.href->detach();
+        }
     }
 }
 
@@ -3673,7 +3675,7 @@ sp_style_write_ifilter(gchar *p, gint const len, gchar const *key,
     {
         if (val->inherit) {
             return g_snprintf(p, len, "%s:inherit;", key);
-        } else if (val->href->getURI()) {
+        } else if (val->href && val->href->getURI()) {
             return g_snprintf(p, len, "%s:url(%s);", key, val->href->getURI()->toString());
         }
     }