mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
menu: ignore <item> without parent <menu>
...to avoid assert() in item_create() because current_menu is NULL.
Reproduce crash with...
<?xml version="1.0" encoding="utf-8"?>
<openbox_menu>
<item label="foo"/>
</openbox_menu>
This commit is contained in:
parent
dc27be2471
commit
4ee538c6cd
1 changed files with 5 additions and 0 deletions
|
|
@ -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 <item> without parent <menu>");
|
||||
continue;
|
||||
}
|
||||
in_item = true;
|
||||
traverse(n, server);
|
||||
in_item = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue