Index: content/browser/host_zoom_map_impl.cc |
diff --git a/content/browser/host_zoom_map_impl.cc b/content/browser/host_zoom_map_impl.cc |
index a0a68dad95a2c860e42b0bb9dc3f519882a6a8b2..c52d54f8f86074dcb63890c56c5ba94462b843b3 100644 |
--- a/content/browser/host_zoom_map_impl.cc |
+++ b/content/browser/host_zoom_map_impl.cc |
@@ -247,11 +247,14 @@ void HostZoomMapImpl::SetZoomLevelForWebContents( |
// WebContentsImpl::GetLastCommittedURL() may give us a virtual url that |
// is different than what the render view is using. If the two don't match, |
// the attempt to set the zoom will fail. |
- GURL url; |
NavigationEntry* entry = |
web_contents_impl.GetController().GetLastCommittedEntry(); |
- DCHECK(entry); |
- url = entry->GetURL(); |
+ // Tests may invoke this function with a null entry, but we don't |
+ // want to save zoom levels in this case. |
+ if (!entry) |
+ return; |
+ |
+ GURL url = entry->GetURL(); |
SetZoomLevelForHost(net::GetHostOrSpecFromURL(url), level); |
} |
} |