Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2783743002: Fix nullptr deref in maybeRenderFallbackContent() (Closed)
Patch Set: Fix tests, handled the non-loading cause in the maybeRenderFallbackContent() if block Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 542a97aa660f388ba2681679f7aebbc97263fa79..30a4b915b9a2f2bc86a15b4a5d4797ecd4d26e40 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -2084,8 +2084,11 @@ bool WebLocalFrameImpl::maybeRenderFallbackContent(
if (!frame()->owner() || !frame()->owner()->canRenderFallbackContent())
return false;
- DCHECK(frame()->loader().provisionalDocumentLoader());
- frame()->loader().provisionalDocumentLoader()->loadFailed(error);
+ // provisionalDocumentLoader() can be null if a navigation started and
+ // completed (e.g. about:blank) while waiting for the navigation that wants
+ // to show fallback content.
+ if (frame()->loader().provisionalDocumentLoader())
+ frame()->loader().provisionalDocumentLoader()->loadFailed(error);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698