aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorMatthew Brush <matt@geany.org>2013-12-13 09:29:58 -0600
committerTed Gould <ted@gould.cx>2013-12-13 09:29:58 -0600
commiteb6d6669fc1f1b20bf3b718e88d1799d766e51eb (patch)
treec5332af064bda2cbdd59d2db94cf2aaaeba08ee6 /libdbusmenu-gtk
parent204376d90bcd8b0a63f00500821aeaad86dadedc (diff)
downloadlibdbusmenu-eb6d6669fc1f1b20bf3b718e88d1799d766e51eb.tar.gz
libdbusmenu-eb6d6669fc1f1b20bf3b718e88d1799d766e51eb.tar.bz2
libdbusmenu-eb6d6669fc1f1b20bf3b718e88d1799d766e51eb.zip
Check to ensure the property isn't set to NULL
Diffstat (limited to 'libdbusmenu-gtk')
-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. */