[ShellAppSystem] Don't crash if the menu system is empty

This is a bit pathological, but if your menu tree is empty, we
shouldn't crash.
This commit is contained in:
Colin Walters 2010-05-20 17:06:30 -04:00
parent 11cde53108
commit 2ce746e7dd

View File

@ -309,9 +309,15 @@ reread_entries (ShellAppSystem *self,
g_slist_free (*cache);
*cache = NULL;
*cache = gather_entries_recurse (self, *cache, unique, trunk);
gmenu_tree_item_unref (trunk);
if (!trunk)
{
*cache = NULL;
}
else
{
*cache = gather_entries_recurse (self, *cache, unique, trunk);
gmenu_tree_item_unref (trunk);
}
}
static void