stack: Fix check if page is selected

When there is no visible child, gtk_selection_model_is_selected()
was returning TRUE for any invalid position.

So check if the page is non-NULL and match
This commit is contained in:
Mohammed Sadiq 2021-03-24 20:23:09 +05:30
parent 0351bc766c
commit e211740da6

View File

@ -562,7 +562,7 @@ gtk_stack_pages_is_selected (GtkSelectionModel *model,
page = g_list_nth_data (priv->children, position);
return page == priv->visible_child;
return page && page == priv->visible_child;
}
static void set_visible_child (GtkStack *stack,