Check if there is json_content to parse at all

This commit is contained in:
Christian Dywan 2011-03-12 03:30:10 +01:00
parent a6c9b73442
commit 1e15abe27c

View file

@ -1463,8 +1463,8 @@ midori_speeddial_import_from_json (const gchar* json_file,
GKeyFile* key_file = g_key_file_new (); GKeyFile* key_file = g_key_file_new ();
g_file_get_contents (json_file, &json_content, NULL, NULL); g_file_get_contents (json_file, &json_content, NULL, NULL);
parts = g_strsplit (json_content, ",", -1); parts = g_strsplit (json_content ? json_content : "", ",", -1);
while (parts[i] != NULL) while (parts && parts[i] != NULL)
{ {
gchar* key; gchar* key;
gchar* val; gchar* val;