gio: Eliminate warnings in cstring conversion on OS X

create_cstr_from_cfstring_with_fallback() is allowed to be called when str == NULL
but create_cstr_from_cfstring() isn't which leads to warnings in the console.
Fix this by adding NULL checks into create_cstr_from_cfstring_with_fallback().

https://bugzilla.gnome.org/show_bug.cgi?id=788936
This commit is contained in:
Jiří Techet 2017-10-22 12:12:59 +02:00 committed by Philip Withnall
parent 6acaca8831
commit 9bcd7800a1

View File

@ -90,8 +90,9 @@ static gchar *
create_cstr_from_cfstring_with_fallback (CFStringRef str,
const gchar *fallback)
{
gchar *cstr;
gchar *cstr = NULL;
if (str)
cstr = create_cstr_from_cfstring (str);
if (!cstr)
return g_strdup (fallback);