Commit ffe25b4a authored by Thomas Guilbert's avatar Thomas Guilbert Committed by Commit Bot

Add null checks in DialogOverlayImpl::Init

Bug: 842402
Change-Id: I0639f8bd383481f8727e149fedb8b46201b895ad
Reviewed-on: https://chromium-review.googlesource.com/1077616Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Commit-Queue: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563049}
parent 4bc016af
...@@ -38,14 +38,14 @@ static jlong JNI_DialogOverlayImpl_Init(JNIEnv* env, ...@@ -38,14 +38,14 @@ static jlong JNI_DialogOverlayImpl_Init(JNIEnv* env,
// reprojection video surface. // reprojection video surface.
RenderWidgetHostViewBase* rwhvb = RenderWidgetHostViewBase* rwhvb =
static_cast<RenderWidgetHostViewBase*>(rfhi->GetView()); static_cast<RenderWidgetHostViewBase*>(rfhi->GetView());
if (rwhvb->IsInVR()) if (!rwhvb || rwhvb->IsInVR())
return 0; return 0;
WebContentsImpl* web_contents_impl = static_cast<WebContentsImpl*>( WebContentsImpl* web_contents_impl = static_cast<WebContentsImpl*>(
content::WebContents::FromRenderFrameHost(rfhi)); content::WebContents::FromRenderFrameHost(rfhi));
// If the overlay would not be immediately used, fail the request. // If the overlay would not be immediately used, fail the request.
if (!rfhi->IsCurrent() || web_contents_impl->IsHidden()) if (!rfhi->IsCurrent() || !web_contents_impl || web_contents_impl->IsHidden())
return 0; return 0;
// Dialog-based overlays are not supported for persistent video. // Dialog-based overlays are not supported for persistent video.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment