aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/history/ephy-history-service.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c
index fb02c80f6..13ed3b3ca 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -432,6 +432,15 @@ ephy_history_service_execute_add_visit_helper (EphyHistoryService *self, EphyHis
{
if (visit->url->host == NULL)
visit->url->host = ephy_history_service_get_host_row_from_url (self, visit->url->url);
+ else if (visit->url->host->id == -1 && visit->url->host->zoom_level != 1.0) {
+ /* This will happen when we migrate the old history to the new
+ * format. We need to store a zoom level for a not-yet-created
+ * host, so we'll end up here. Ugly, but it works. */
+ double zoom_level = visit->url->host->zoom_level;
+ ephy_history_host_free (visit->url->host);
+ visit->url->host = ephy_history_service_get_host_row_from_url (self, visit->url->url);
+ visit->url->host->zoom_level = zoom_level;
+ }
visit->url->host->visit_count++;
ephy_history_service_update_host_row (self, visit->url->host);