Openbox plugin: don't fail on empty <keybind> tag, just ignore and remove it.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Wed, 2 Nov 2016 20:35:58 +0000 (22:35 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Wed, 2 Nov 2016 20:35:58 +0000 (22:35 +0200)
plugins/openbox/openbox.c

index 5ad44bf..8a4e05e 100644 (file)
@@ -526,10 +526,10 @@ static gboolean tag_handler_keybind(FmXmlFileItem *item, GList *children,
     LXHotkeyGlobal *act;
     guint i;
 
-    if (!cfg->stack) { /* corruption! */
-        g_set_error_literal(error, LXKEYS_OB_ERROR, LXKEYS_PARSE_ERROR,
-                            _("Internal error."));
-        return FALSE;
+    if (!cfg->stack) { /* empty keybind tag, just ignore it and remove */
+        g_warning("Openbox config: empty keybind tag in rc.xml, going to remove it");
+        fm_xml_file_item_destroy(item);
+        return TRUE;
     }
     oblist = cfg->stack->data;
     if (oblist->parent != item) { /* corruption! */