[gnc-report] Handle default_font_family being NULL

There was invalid assumption in afea6fd68. According to the following
documentation, pango_font_description_get_family can return NULL, and
g_strdup (NULL) also returns NULL.

https://docs.gtk.org/Pango/method.FontDescription.get_family.html
This commit is contained in:
Christopher Lam 2021-07-31 21:11:56 +08:00
parent b8dad64b7e
commit b9d6fc9f4f

View File

@ -336,7 +336,9 @@ gnc_get_default_report_font_family(void)
pango_font_description_free (font_desc);
if (g_str_has_prefix (default_font_family, ".AppleSystemUIFont"))
if (!default_font_family)
return g_strdup ("Arial");
else if (g_str_has_prefix (default_font_family, ".AppleSystemUIFont"))
{
g_free (default_font_family);
return g_strdup ("Arial");