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
This commit is contained in:
Vincent Untz 2011-10-11 22:51:42 +02:00 committed by Bastien Nocera
parent 45a9b2cb1f
commit 80bd53ce10

View file

@ -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;