aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Brush <matt@geany.org>2013-12-19 16:07:56 +0000
committerTarmac <Unknown>2013-12-19 16:07:56 +0000
commit4120520cec4e19e45275d17680a98b1ea53a4d56 (patch)
treec5332af064bda2cbdd59d2db94cf2aaaeba08ee6
parent204376d90bcd8b0a63f00500821aeaad86dadedc (diff)
parenteb6d6669fc1f1b20bf3b718e88d1799d766e51eb (diff)
downloadlibdbusmenu-4120520cec4e19e45275d17680a98b1ea53a4d56.tar.gz
libdbusmenu-4120520cec4e19e45275d17680a98b1ea53a4d56.tar.bz2
libdbusmenu-4120520cec4e19e45275d17680a98b1ea53a4d56.zip
Check to ensure the property isn't set to NULL. Fixes: https://bugs.launchpad.net/bugs/907635.
Approved by PS Jenkins bot, Ted Gould.
-rw-r--r--libdbusmenu-gtk/parser.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index c9ec931..461927f 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -1313,8 +1313,12 @@ widget_notify_cb (GtkWidget * widget, GParamSpec * pspec, gpointer data)
if (item != NULL) {
GtkWidget * menu = GTK_WIDGET (g_value_get_object (&prop_value));
- parse_menu_structure_helper(menu, &recurse);
- watch_submenu(item, menu);
+ /* Ensure the submenu isn't being set to NULL to remove it
+ * (ex. Geany does this) */
+ if (menu != NULL) {
+ parse_menu_structure_helper(menu, &recurse);
+ watch_submenu(item, menu);
+ }
} else {
/* Note: it would be really odd that we wouldn't have a cached
item, but we should handle that appropriately. */