Skip to content

Commit

Permalink
Fixed Android NullPointerException on InAppBrowserActivity.dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Nov 18, 2022
1 parent 7539d26 commit 81d83a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.7.1+2

- Fixed Android `NullPointerException` on `InAppBrowserActivity.dispose`

## 5.7.1+1

- Fixed User Script remove methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
public class InAppBrowserActivity extends AppCompatActivity implements InAppBrowserDelegate {

static final String LOG_TAG = "InAppBrowserActivity";
@Nullable
public MethodChannel channel;
public Integer windowId;
public String id;
Expand Down Expand Up @@ -522,7 +523,10 @@ protected void onActivityResult (int requestCode,
}

public void dispose() {
channel.setMethodCallHandler(null);
if (channel != null) {
channel.setMethodCallHandler(null);
channel = null;
}
activityResultListeners.clear();
if (methodCallDelegate != null) {
methodCallDelegate.dispose();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_inappwebview
description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
version: 5.7.1+1
version: 5.7.1+2
homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
Expand Down

0 comments on commit 81d83a2

Please # to comment.