From f681278855246b87f89a86638f42af42daa1b93c Mon Sep 17 00:00:00 2001 From: Felix Kirchengast <17876666+fkirc@users.noreply.github.com> Date: Thu, 24 Sep 2020 05:56:48 +0200 Subject: [PATCH] fix(android): BridgeFragment NullPointerException (#3553) --- .../src/main/java/com/getcapacitor/BridgeFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/BridgeFragment.java b/android/capacitor/src/main/java/com/getcapacitor/BridgeFragment.java index e60e988cc1..a527a7a587 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/BridgeFragment.java +++ b/android/capacitor/src/main/java/com/getcapacitor/BridgeFragment.java @@ -153,7 +153,9 @@ public void onActivityCreated(Bundle savedInstanceState) { @Override public void onDestroy() { super.onDestroy(); - this.bridge.onDestroy(); + if (this.bridge != null) { + this.bridge.onDestroy(); + } if (this.mockWebView != null) { mockWebView.handleDestroy(); }