diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index af6ef4f05a125c5718c0f76a88e64e7a535072f0..c167be493c0900a05a12b9560472da180c80b6a8 100644 (file)
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
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")));