Commit 0c22fcff authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Android: Speculative fix to a preview tab crash bug

Adds null checks against thinwebview object to attempt to fix the
reported crash bug to do null pointer dereference. This is a
speculative fix since the bug has not been reproducible locally.

Bug: 1030616
Change-Id: I1541133691b33e2d685bd3fd6b0ab08feb3a1e49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1984795Reviewed-by: default avatarShakti Sahu <shaktisahu@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727939}
parent 6ceb9386
......@@ -56,6 +56,7 @@ public class ThinWebViewImpl extends FrameLayout implements ThinWebView {
@Override
public void attachWebContents(WebContents webContents, @Nullable View contentView) {
if (mNativeThinWebViewImpl == 0) return;
mWebContents = webContents;
setContentView(contentView);
......@@ -66,11 +67,10 @@ public class ThinWebViewImpl extends FrameLayout implements ThinWebView {
@Override
public void destroy() {
if (mNativeThinWebViewImpl == 0) return;
mCompositorView.destroy();
if (mNativeThinWebViewImpl != 0) {
ThinWebViewImplJni.get().destroy(mNativeThinWebViewImpl, ThinWebViewImpl.this);
mNativeThinWebViewImpl = 0;
}
ThinWebViewImplJni.get().destroy(mNativeThinWebViewImpl, ThinWebViewImpl.this);
mNativeThinWebViewImpl = 0;
}
@Override
......@@ -80,6 +80,7 @@ public class ThinWebViewImpl extends FrameLayout implements ThinWebView {
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
if (mNativeThinWebViewImpl == 0) return;
if (w != oldw || h != oldh) {
ThinWebViewImplJni.get().sizeChanged(
mNativeThinWebViewImpl, ThinWebViewImpl.this, w, h);
......
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