From 1e15abe27c996e3a8eb8983a4af2740b437bff00 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 12 Mar 2011 03:30:10 +0100 Subject: [PATCH] Check if there is json_content to parse at all --- midori/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5