modelbutton: Avoid a crash

We may not have a popover menu ancestor. The check for
this was forgotten in one of the branches here.

Fixes: #3831
This commit is contained in:
Matthias Clasen 2021-04-05 14:06:42 -04:00
parent b79eb55b34
commit 303ff60d5e

View File

@ -1404,7 +1404,8 @@ pointer_cb (GObject *object,
GtkModelButton *button = data;
stop_open (button);
gtk_popover_menu_set_active_item (GTK_POPOVER_MENU (popover), NULL);
if (popover)
gtk_popover_menu_set_active_item (GTK_POPOVER_MENU (popover), NULL);
}
}