From ec2c67338a77bbd0759e392147413cd7a820e67f Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Mon, 19 Jul 2021 07:07:33 +0100 Subject: [PATCH] rcxml.c: survive incorrect keybind --- src/config/rcxml.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/config/rcxml.c b/src/config/rcxml.c index dd133573..c40e2849 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -40,8 +40,14 @@ fill_keybind(char *nodename, char *content) if (!strcmp(nodename, "key")) { current_keybind = keybind_create(content); } - /* We expect to come first */ - assert(current_keybind); + /* + * We expect 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")) {