common: Fix crash in language chooser

A report in Red Hat bugzilla [1] shows for some reason the country is set to
NULL and this causes a crash when comparing against search terms. The solution
is to handle the NULL without crashing.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1685251
This commit is contained in:
Robert Ancell 2019-03-26 12:14:03 +13:00 committed by Georges Basile Stavracas Neto
parent ecb809bb89
commit e85816f83b

View file

@ -188,6 +188,9 @@ match_all (gchar **words,
{ {
gchar **w; gchar **w;
if (str == NULL)
return FALSE;
for (w = words; *w; ++w) for (w = words; *w; ++w)
if (!strstr (str, *w)) if (!strstr (str, *w))
return FALSE; return FALSE;