Skip to content

Commit 9826ff8

Browse files
committed
chore: refactor
1 parent 4915b04 commit 9826ff8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/webview/index.android.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,10 @@ function initializeWebViewClient(): void {
464464
return false;
465465
}
466466
async _onPermissionsRequest(permissionRequest: android.webkit.PermissionRequest) {
467+
const owner = this.owner?.get();
468+
if (!owner) {
469+
return;
470+
}
467471
try {
468472
const requests = permissionRequest.getResources();
469473
const wantedPermissions = new Array();
@@ -485,7 +489,7 @@ function initializeWebViewClient(): void {
485489
if (requestedPermissions.length === 0) {
486490
permissionRequest.deny();
487491
}
488-
await this.owner.get()._onRequestPermissions(wantedPermissions);
492+
await owner._onRequestPermissions(wantedPermissions);
489493

490494
permissionRequest.grant(requestedPermissions);
491495
} catch (err) {

0 commit comments

Comments
 (0)