From 779678d1e26fea17dfb461a3fbc5bc268a7a9dc4 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Fri, 7 Feb 2020 22:04:15 -0800 Subject: [PATCH] Added null check to fix gtk-critical message --- src/wofi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wofi.c b/src/wofi.c index 79d4b74..5879972 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -160,7 +160,10 @@ static gboolean do_search(gpointer data) { filter = strdup(new_filter); gtk_flow_box_invalidate_filter(GTK_FLOW_BOX(inner_box)); gtk_flow_box_invalidate_sort(GTK_FLOW_BOX(inner_box)); - gtk_flow_box_select_child(GTK_FLOW_BOX(inner_box), gtk_flow_box_get_child_at_index(GTK_FLOW_BOX(inner_box), 0)); + GtkFlowBoxChild* child = gtk_flow_box_get_child_at_index(GTK_FLOW_BOX(inner_box), 0); + if(child != NULL) { + gtk_flow_box_select_child(GTK_FLOW_BOX(inner_box), child); + } } return G_SOURCE_CONTINUE; }