popovermenu: Fail gracefully if no model

If we don't have a model yet, return FALSE from
gtk_popover_menu_add_custom().
This commit is contained in:
Matthias Clasen 2020-11-04 14:56:52 -05:00
parent d2cc9365fc
commit 8ae415acff

View File

@ -696,6 +696,8 @@ gtk_menu_section_box_add_custom (GtkPopoverMenu *popover,
stack = gtk_popover_get_child (GTK_POPOVER (popover));
box = GTK_MENU_SECTION_BOX (gtk_stack_get_child_by_name (GTK_STACK (stack), "main"));
if (box == NULL)
return FALSE;
slot = (GtkWidget *)g_hash_table_lookup (box->custom_slots, id);