From ef9580b287fdba269840e666444507eb417e88f3 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Thu, 5 May 2022 22:00:44 +0200 Subject: [PATCH] Fixed possible Android java.lang.NullPointerException in InAppBrowserActivity.onCreateOptionsMenu about webView.getTitle() --- CHANGELOG.md | 4 ++++ .../in_app_browser/InAppBrowserActivity.java | 2 +- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6b18dc5..de330bb6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.4.3+7 + +- Fixed possible Android java.lang.NullPointerException in InAppBrowserActivity.onCreateOptionsMenu about webView.getTitle() + ## 5.4.3+6 - Fixed "iOS flutter_inappwebview/URLRequest.swift:13: Fatal error: Unexpectedly found nil while unwrapping an Optional value" [#1173](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1173) diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_browser/InAppBrowserActivity.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_browser/InAppBrowserActivity.java index 23687766..108ef0f4 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_browser/InAppBrowserActivity.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_browser/InAppBrowserActivity.java @@ -208,7 +208,7 @@ public class InAppBrowserActivity extends AppCompatActivity implements InAppBrow menu = m; if (actionBar != null && (options.toolbarTopFixedTitle == null || options.toolbarTopFixedTitle.isEmpty())) - actionBar.setTitle(webView.getTitle()); + actionBar.setTitle(webView != null ? webView.getTitle() : ""); if (menu == null) return super.onCreateOptionsMenu(m); diff --git a/pubspec.yaml b/pubspec.yaml index 56c02568..32ce620c 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.4.3+6 +version: 5.4.3+7 homepage: https://github.com/pichillilorenzo/flutter_inappwebview environment: