Commit 63a85ab6 authored by Dominick Ng's avatar Dominick Ng Committed by Commit Bot

Zero-check mNativePointer in AppBannerUiDelegateAndroid.

This is a speculative fix for crashes caused by native methods being
called after this object is destroyed.

BUG=871129

Change-Id: Id620402711979e6e380dd8e307cca098619e962d
Reviewed-on: https://chromium-review.googlesource.com/1163407Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581020}
parent 5f1ae0ce
...@@ -42,17 +42,21 @@ public class AppBannerUiDelegateAndroid ...@@ -42,17 +42,21 @@ public class AppBannerUiDelegateAndroid
public void addToHomescreen(String title) { public void addToHomescreen(String title) {
mAddedToHomescreen = true; mAddedToHomescreen = true;
// The title is ignored for app banners as we respect the developer-provided title. // The title is ignored for app banners as we respect the developer-provided title.
nativeAddToHomescreen(mNativePointer); if (mNativePointer != 0) {
nativeAddToHomescreen(mNativePointer);
}
} }
@Override @Override
public void onNativeAppDetailsRequested() { public void onNativeAppDetailsRequested() {
nativeShowNativeAppDetails(mNativePointer); if (mNativePointer != 0) {
nativeShowNativeAppDetails(mNativePointer);
}
} }
@Override @Override
public void onDialogDismissed() { public void onDialogDismissed() {
if (!mAddedToHomescreen) { if (!mAddedToHomescreen && mNativePointer != 0) {
nativeOnUiCancelled(mNativePointer); nativeOnUiCancelled(mNativePointer);
} }
......
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