Only show the menu if we have it.
[dhcpcd-ui] / src / dhcpcd-gtk / menu.c
index f2d5806556c2f508ed5f2b6448d8573570e9a516..59524c0c9fa6a7769694895035a8da7090cf02cf 100644 (file)
@@ -365,10 +365,12 @@ on_activate(GtkStatusIcon *icon)
                w->ifmenu = menu = add_scans(w);
        }
 
-       gtk_widget_show_all(GTK_WIDGET(menu));
-       gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
-           gtk_status_icon_position_menu, icon,
-           1, gtk_get_current_event_time());
+       if (menu) {
+               gtk_widget_show_all(GTK_WIDGET(menu));
+               gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
+                   gtk_status_icon_position_menu, icon,
+                   1, gtk_get_current_event_time());
+       }
 }
 
 static void