Code

Filter effects dialog:
[inkscape.git] / src / inkscape.cpp
index af6ef4f05a125c5718c0f76a88e64e7a535072f0..c167be493c0900a05a12b9560472da180c80b6a8 100644 (file)
@@ -727,11 +727,16 @@ inkscape_load_menus (Inkscape::Application *inkscape)
 Inkscape::XML::Node *
 inkscape_get_repr (Inkscape::Application *inkscape, const gchar *key)
 {
-    if (key == NULL) {
+    if ( (key == NULL) || (inkscape == NULL) ) {
         return NULL;
     }
 
-    Inkscape::XML::Node *repr = Inkscape::Preferences::get()->root();
+    Inkscape::XML::Node *prefs = Inkscape::Preferences::get();
+    if ( !prefs ) {
+        return NULL;
+    }
+
+    Inkscape::XML::Node *repr = prefs->root();
     if (!repr) return NULL;
     g_assert (!(strcmp (repr->name(), "inkscape")));