From 115faae37187d13a9e022aad47f692ee87a4de59 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 9 Jun 2014 09:36:47 -0400 Subject: [PATCH] GtkSearchBar: Handle lack of an entry We were not dealing with the possibility of priv->entry being NULL in all places. --- gtk/gtksearchbar.c | 11 +++++++---- 1 file 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"); }