From b2d879e23ef18ce97e71f95d784da4d672874b4b Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 27 Oct 2017 20:52:00 +0200 Subject: Protect against missing "id". --- src/preferences.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/preferences.cpp b/src/preferences.cpp index 7ebf55a79..b02e71e46 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -393,6 +393,9 @@ std::vector Preferences::getAllDirs(Glib::ustring const &path) Inkscape::XML::Node *node = _getNode(path, false); if (node) { for (Inkscape::XML::NodeSiblingIterator i = node->firstChild(); i; ++i) { + if (i->attribute("id") == NULL) { + continue; + } temp.push_back(path + '/' + i->attribute("id")); } } @@ -702,6 +705,9 @@ Inkscape::XML::Node *Preferences::_getNode(Glib::ustring const &pref_key, bool c } for (child = node->firstChild(); child; child = child->next()) { + if (child->attribute("id") == NULL) { + continue; + } if (!strcmp(splits[part_i], child->attribute("id"))) { break; } -- cgit v1.2.3