]> git.mdlowis.com Git - proto/labwc.git/commitdiff
rcxml.c: survive incorrect keybind
authorJohan Malm <jgm323@gmail.com>
Mon, 19 Jul 2021 06:07:33 +0000 (07:07 +0100)
committerJohan Malm <jgm323@gmail.com>
Mon, 19 Jul 2021 06:07:33 +0000 (07:07 +0100)
src/config/rcxml.c

index dd13357345c47e8f98449fc53b77c6e4487e8bd7..c40e28497e92d6100821fe8915e08d743bf72319 100644 (file)
@@ -40,8 +40,14 @@ fill_keybind(char *nodename, char *content)
        if (!strcmp(nodename, "key")) {
                current_keybind = keybind_create(content);
        }
-       /* We expect <keybind key=""> to come first */
-       assert(current_keybind);
+       /*
+        * We expect <keybind key=""> to come first
+        * If a invalid keybind has been provided, keybind_create() complains
+        * so we just silently ignore it here.
+        */
+       if (!current_keybind) {
+               return;
+       }
        if (!strcmp(nodename, "name.action")) {
                current_keybind->action = strdup(content);
        } else if (!strcmp(nodename, "command.action")) {