[gnome-control-center] shell: Avoid crash when searching if a .desktop has no comment



commit 80bd53ce108a508271d2e025bb5713dbcfb81215
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Oct 11 22:51:42 2011 +0200

    shell: Avoid crash when searching if a .desktop has no comment
    
    The code doing the search assumes the description column is set, which
    might not be the case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=661494

 shell/shell-search-renderer.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/shell/shell-search-renderer.c b/shell/shell-search-renderer.c
index 0667bc0..6032af8 100644
--- a/shell/shell-search-renderer.c
+++ b/shell/shell-search-renderer.c
@@ -154,12 +154,15 @@ shell_search_renderer_set_layout (ShellSearchRenderer *cell, GtkWidget *widget)
     needle = g_utf8_casefold (priv->search_string, -1);
   else
     needle = NULL;
-  haystack = g_utf8_casefold (full_string, -1);
+  if (full_string != NULL)
+    haystack = g_utf8_casefold (full_string, -1);
+  else
+    haystack = NULL;
 
   /* clear any previous attributes */
   pango_layout_set_attributes (priv->layout, NULL);
 
-  if (priv->search_string && priv->title
+  if (priv->search_string && priv->search_target && priv->title
       && (strstr (haystack, needle)))
     {
       gchar *start;



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