From: Christian Dywan Date: Sat, 12 Mar 2011 02:30:10 +0000 (+0100) Subject: Check if there is json_content to parse at all X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e15abe27c996e3a8eb8983a4af2740b437bff00;p=midori Check if there is json_content to parse at all --- diff --git a/midori/main.c b/midori/main.c index 544d6bc9..a08a4c0b 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1463,8 +1463,8 @@ midori_speeddial_import_from_json (const gchar* json_file, GKeyFile* key_file = g_key_file_new (); g_file_get_contents (json_file, &json_content, NULL, NULL); - parts = g_strsplit (json_content, ",", -1); - while (parts[i] != NULL) + parts = g_strsplit (json_content ? json_content : "", ",", -1); + while (parts && parts[i] != NULL) { gchar* key; gchar* val;