Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 4755716effca5085531146e6c63cf52996454939..9ae71800aab6aa9e9ad02031ca428814f266a797 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -3959,10 +3959,15 @@ void WebContentsImpl::UpdateState(RenderViewHost* rvh, |
if (!entry) |
return; |
- NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID( |
- static_cast<RenderFrameHostImpl*>(rvhi->GetMainFrame())->nav_entry_id()); |
- |
- DCHECK_EQ(entry, new_entry); |
+ // Sanity check that ensures nav_entry_id and page_id point to the same |
+ // navigation entry. |
+ if (rvhi->GetMainFrame()) { |
+ NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID( |
+ static_cast<RenderFrameHostImpl*>(rvhi->GetMainFrame()) |
+ ->nav_entry_id()); |
+ |
+ DCHECK_EQ(entry, new_entry); |
+ } |
if (page_state == entry->GetPageState()) |
return; // Nothing to update. |