diff options
Diffstat (limited to 'gtk/gtkentrycompletion.c')
-rw-r--r-- | gtk/gtkentrycompletion.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index da969f8f07..a4bf298111 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -507,15 +507,18 @@ gtk_entry_completion_default_completion_func (GtkEntryCompletion *completion, completion->priv->text_column, &item, -1); - normalized_string = g_utf8_normalize (item, -1, G_NORMALIZE_ALL); - case_normalized_string = g_utf8_casefold (normalized_string, -1); - - if (!strncmp (key, case_normalized_string, strlen (key))) - ret = TRUE; - - g_free (item); - g_free (normalized_string); - g_free (case_normalized_string); + if (item != NULL) + { + normalized_string = g_utf8_normalize (item, -1, G_NORMALIZE_ALL); + case_normalized_string = g_utf8_casefold (normalized_string, -1); + + if (!strncmp (key, case_normalized_string, strlen (key))) + ret = TRUE; + + g_free (item); + g_free (normalized_string); + g_free (case_normalized_string); + } return ret; } |