aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
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. */