From e211740da6ced87ec59a7231be2e3fba64d2dfb2 Mon Sep 17 00:00:00 2001 From: Mohammed Sadiq Date: Wed, 24 Mar 2021 20:23:09 +0530 Subject: [PATCH] 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 --- gtk/gtkstack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 9b1488b3b2..e784b0c30f 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -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,