summaryrefslogtreecommitdiffstats
path: root/android_webview/native/aw_contents.cc
diff options
context:
space:
mode:
Diffstat (limited to 'android_webview/native/aw_contents.cc')
-rw-r--r--android_webview/native/aw_contents.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index b9db7c1..6e9c1fe 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -550,10 +550,10 @@ void AwContents::OnPermissionRequest(AwPermissionRequest* request) {
void AwContents::OnPermissionRequestCanceled(AwPermissionRequest* request) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> j_request = request->GetJavaObject();
- if (j_request.is_null())
+ ScopedJavaLocalRef<jobject> j_ref = java_ref_.get(env);
+ if (j_request.is_null() || j_ref.is_null())
return;
- ScopedJavaLocalRef<jobject> j_ref = java_ref_.get(env);
Java_AwContents_onPermissionRequestCanceled(
env, j_ref.obj(), j_request.obj());
}