From 04a1254e7a88d0bb7e2fd5f68779d086bf93e4b3 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Thu, 9 Jan 2014 00:52:26 +0100 Subject: add null check: should fix bug #1163241 (inkscape crashed with SIGSEGV in Inkscape::Preferences::_getNode()) (bzr r12902) --- src/preferences.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/preferences.cpp') diff --git a/src/preferences.cpp b/src/preferences.cpp index 0dcebbb90..b4b873dc8 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -668,6 +668,9 @@ Inkscape::XML::Node *Preferences::_getNode(Glib::ustring const &pref_key, bool c // No longer necessary, can cause problems with input devices which have a dot in the name // g_assert( pref_key.find('.') == Glib::ustring::npos ); + if (_prefs_doc == NULL){ + return NULL; + } Inkscape::XML::Node *node = _prefs_doc->root(); Inkscape::XML::Node *child = NULL; gchar **splits = g_strsplit(pref_key.c_str(), "/", 0); -- cgit v1.2.3