aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-03-21 21:41:36 +0800
committerXan Lopez <xan@igalia.com>2012-03-21 21:41:36 +0800
commit087cb32d81fd8ef1cf3f493fce9e80e7217dbf04 (patch)
tree8ba68189c0b736b71420f4b5f838de0067f95515
parent36f0e578c2d5de9afede9fb1b6a8c522e9f1bf17 (diff)
downloadgsoc2013-epiphany-087cb32d81fd8ef1cf3f493fce9e80e7217dbf04.tar
gsoc2013-epiphany-087cb32d81fd8ef1cf3f493fce9e80e7217dbf04.tar.gz
gsoc2013-epiphany-087cb32d81fd8ef1cf3f493fce9e80e7217dbf04.tar.bz2
gsoc2013-epiphany-087cb32d81fd8ef1cf3f493fce9e80e7217dbf04.tar.lz
gsoc2013-epiphany-087cb32d81fd8ef1cf3f493fce9e80e7217dbf04.tar.xz
gsoc2013-epiphany-087cb32d81fd8ef1cf3f493fce9e80e7217dbf04.tar.zst
gsoc2013-epiphany-087cb32d81fd8ef1cf3f493fce9e80e7217dbf04.zip
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
-rw-r--r--lib/ephy-profile-migrator.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ephy-profile-migrator.c b/lib/ephy-profile-migrator.c
index f7a34069a..a37638c25 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);
}