diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-06-09 09:36:47 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-06-09 13:31:09 -0400 |
commit | 115faae37187d13a9e022aad47f692ee87a4de59 (patch) | |
tree | c53bf471f94359982076e84447e9e0047401733f | |
parent | 0dd1102cc4c6c2c42a709a6e6d262933ad3eb6d6 (diff) | |
download | gtk+-115faae37187d13a9e022aad47f692ee87a4de59.tar.gz |
GtkSearchBar: Handle lack of an entry
We were not dealing with the possibility of priv->entry being
NULL in all places.
-rw-r--r-- | gtk/gtksearchbar.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c index 8104abef12..1181d48ce7 100644 --- a/gtk/gtksearchbar.c +++ b/gtk/gtksearchbar.c @@ -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"); } |