Added null check to fix gtk-critical message

This commit is contained in:
Scoopta 2020-02-07 22:04:15 -08:00
parent bafdea787f
commit 779678d1e2

View File

@ -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;
}