From 9076d51301bf115dc66dd3348fa537baee34e0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jir=CC=8Ci=CC=81=20Techet?= Date: Sun, 22 Oct 2017 12:12:59 +0200 Subject: [PATCH] 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 --- gio/gosxcontenttype.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gio/gosxcontenttype.c b/gio/gosxcontenttype.c index b646f6e57..347477577 100644 --- a/gio/gosxcontenttype.c +++ b/gio/gosxcontenttype.c @@ -90,9 +90,10 @@ static gchar * create_cstr_from_cfstring_with_fallback (CFStringRef str, const gchar *fallback) { - gchar *cstr; + gchar *cstr = NULL; - cstr = create_cstr_from_cfstring (str); + if (str) + cstr = create_cstr_from_cfstring (str); if (!cstr) return g_strdup (fallback);