Check |delegate_| for nullptr before use.
Change-Id: Icb9ed445fa93d0206801eac21117494672165c2a
Reviewed-on: https://chromium-review.googlesource.com/895766
Commit-Queue: Avi Drissman <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#533565}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 31e65f9e7..7bdf8df 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3911,7 +3911,9 @@
}
void WebContentsImpl::PassiveInsecureContentFound(const GURL& resource_url) {
- GetDelegate()->PassiveInsecureContentFound(resource_url);
+ if (delegate_) {
+ delegate_->PassiveInsecureContentFound(resource_url);
+ }
}
bool WebContentsImpl::ShouldAllowRunningInsecureContent(
@@ -3919,8 +3921,12 @@
bool allowed_per_prefs,
const url::Origin& origin,
const GURL& resource_url) {
- return GetDelegate()->ShouldAllowRunningInsecureContent(
- web_contents, allowed_per_prefs, origin, resource_url);
+ if (delegate_) {
+ return delegate_->ShouldAllowRunningInsecureContent(
+ web_contents, allowed_per_prefs, origin, resource_url);
+ }
+
+ return allowed_per_prefs;
}
void WebContentsImpl::ViewSource(RenderFrameHostImpl* frame) {