[gnome-shell] [ShellAppSystem] Don't crash if the menu system is empty
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] [ShellAppSystem] Don't crash if the menu system is empty
- Date: Thu, 20 May 2010 21:34:51 +0000 (UTC)
commit 2ce746e7dd64fc36b0767bd0551d2a6b7349a669
Author: Colin Walters <walters verbum org>
Date: Thu May 20 17:06:30 2010 -0400
[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.
src/shell-app-system.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/shell-app-system.c b/src/shell-app-system.c
index ad8cef4..faa960e 100644
--- a/src/shell-app-system.c
+++ b/src/shell-app-system.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]