[Xfce4-commits] <midori:master> Check if there is json_content to parse at all

Christian Dywan noreply at xfce.org
Sat Mar 12 03:36:03 CET 2011


Updating branch refs/heads/master
         to 1e15abe27c996e3a8eb8983a4af2740b437bff00 (commit)
       from a6c9b734424c8bb6bf027bd3c5645b87fe3e3107 (commit)

commit 1e15abe27c996e3a8eb8983a4af2740b437bff00
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Mar 12 03:30:10 2011 +0100

    Check if there is json_content to parse at all

 midori/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index 544d6bc..a08a4c0 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;



More information about the Xfce4-commits mailing list