[epiphany] profile-migrator: do not freak out if the history is empty



commit 087cb32d81fd8ef1cf3f493fce9e80e7217dbf04
Author: Xan Lopez <xan igalia com>
Date:   Wed Mar 21 14:41:36 2012 +0100

    profile-migrator: do not freak out if the history is empty
    
    If the old history file exists but has no actual visits we'll enter
    into an infinite loop.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672547

 lib/ephy-profile-migrator.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/lib/ephy-profile-migrator.c b/lib/ephy-profile-migrator.c
index f7a3406..a37638c 100644
--- a/lib/ephy-profile-migrator.c
+++ b/lib/ephy-profile-migrator.c
@@ -594,11 +594,13 @@ migrate_history ()
   g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
   g_object_unref (input);
 
-  ephy_history_service_add_visits (history_service, parse_data.visits, NULL, (EphyHistoryJobCallback)visit_cb, NULL);
-  ephy_history_page_visit_list_free (parse_data.visits);
+  if (parse_data.visits) {
+    ephy_history_service_add_visits (history_service, parse_data.visits, NULL, (EphyHistoryJobCallback)visit_cb, NULL);
+    ephy_history_page_visit_list_free (parse_data.visits);
 
-  while (!all_done)
-    g_main_context_iteration (NULL, FALSE);
+    while (!all_done)
+      g_main_context_iteration (NULL, FALSE);
+  }
 
   g_object_unref (history_service);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]