1
0
gnome-control-center/gnome-control-center-shell-no-crash.patch

34 lines
1.1 KiB
Diff

commit 59fe530504a4359f66d9a112050970a52fe46281
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
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;