From f43c8c2c681506d590b181906b923b24e4d5032b Mon Sep 17 00:00:00 2001 From: rsydor <79581663+rsydor@users.noreply.github.com> Date: Mon, 6 Dec 2021 17:09:57 +0100 Subject: [PATCH] Update InAppWebView.java Fix crash --- .../flutter_inappwebview/in_app_webview/InAppWebView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java index dcde9159..63354eed 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java @@ -1302,7 +1302,7 @@ final public class InAppWebView extends InputAwareWebView { public void run() { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE); - if (imm != null && !imm.isAcceptingText()) { + if (containerView!=null && imm != null && !imm.isAcceptingText()) { imm.hideSoftInputFromWindow( containerView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);