GtkSearchBar: Handle lack of an entry

We were not dealing with the possibility of priv->entry being
NULL in all places.
This commit is contained in:
Matthias Clasen 2014-06-09 09:36:47 -04:00
parent 0dd1102cc4
commit 115faae371

View File

@ -254,10 +254,13 @@ reveal_child_changed_cb (GObject *object,
priv->reveal_child = reveal_child;
if (reveal_child)
_gtk_entry_grab_focus (GTK_ENTRY (priv->entry), FALSE);
else
gtk_entry_set_text (GTK_ENTRY (priv->entry), "");
if (priv->entry)
{
if (reveal_child)
_gtk_entry_grab_focus (GTK_ENTRY (priv->entry), FALSE);
else
gtk_entry_set_text (GTK_ENTRY (priv->entry), "");
}
g_object_notify (G_OBJECT (bar), "search-mode-enabled");
}