[empathy] check if the search widget exists before trying to use it



commit 2bae9ac9f9dded0762344c1478202d78e7f01200
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Jun 11 14:56:17 2010 +0200

    check if the search widget exists before trying to use it

 libempathy-gtk/empathy-contact-list-view.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 200524d..ec286de 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -149,6 +149,8 @@ contact_list_view_is_visible_contact (EmpathyContactListView *self,
 	gchar *dup_str = NULL;
 	gboolean visible;
 
+	g_assert (live != NULL);
+
 	/* check alias name */
 	str = empathy_contact_get_name (contact);
 	if (empathy_live_search_match (live, str))
@@ -183,7 +185,8 @@ contact_list_view_filter_visible_func (GtkTreeModel *model,
 	GtkTreeIter                 child_iter;
 	gboolean                    visible;
 
-	if (!gtk_widget_get_visible (priv->search_widget))
+	if (priv->search_widget == NULL ||
+	    !gtk_widget_get_visible (priv->search_widget))
 		return TRUE;
 
 	gtk_tree_model_get (model, iter,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]