From 93d9b41ed888c8fc95b792c259c235a86555dc9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Powa=C5=82owski?= Date: Mon, 27 Jun 2022 16:58:12 +0200 Subject: [PATCH] fix: Prevent Android java.lang.NullPointerException in InAppWebViewClient.onReceivedHttpAuthRequest view.getUrl() --- .../in_app_webview/InAppWebViewClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebViewClient.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebViewClient.java index 68d0e0b0..86e31013 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebViewClient.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebViewClient.java @@ -331,7 +331,9 @@ public class InAppWebViewClient extends WebViewClient { URI uri; try { - uri = new URI(view.getUrl()); + String url = view.getUrl(); + if (url == null) return; + uri = new URI(url); } catch (URISyntaxException e) { e.printStackTrace();