From: Johan Malm Date: Thu, 13 Jun 2024 20:00:44 +0000 (+0100) Subject: menu: ignore without parent X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=4ee538c6cd60b3fd7daeaa4e394d2b6a519e7642;p=proto%2Flabwc.git menu: ignore without parent ...to avoid assert() in item_create() because current_menu is NULL. Reproduce crash with... --- diff --git a/src/menu/menu.c b/src/menu/menu.c index a30fcba2..9342ab28 100644 --- a/src/menu/menu.c +++ b/src/menu/menu.c @@ -605,6 +605,11 @@ xml_tree_walk(xmlNode *node, struct server *server) continue; } if (!strcasecmp((char *)n->name, "item")) { + if (!current_menu) { + wlr_log(WLR_ERROR, + "ignoring without parent "); + continue; + } in_item = true; traverse(n, server); in_item = false;