Commit 9ef81a08 authored by Beniamino Galvani's avatar Beniamino Galvani

editor: avoid crash when checking for visible children

When a connection is added the editor adds a new empty item to the
tree store with gtk_tree_store_append() and then populates
it. Therefore, has_visible_children() must be prepared to deal with
missing values.

Fixes: 4645c9ae

https://bugzilla.redhat.com/show_bug.cgi?id=1543958
parent aa9bb9e4
......@@ -667,6 +667,11 @@ has_visible_children (NMConnectionList *self, GtkTreeModel *model, GtkTreeIter *
search = gtk_entry_get_text (GTK_ENTRY (priv->search_entry));
do {
gtk_tree_model_get (model, &iter, COL_ID, &id, -1);
if (!id) {
/* gtk_tree_store_append() inserts an empty row, ignore
* it until it is fully populated. */
continue;
}
if (strcasestr (id, search) != NULL) {
g_free (id);
return TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment