From 47161c9d9c208d3c446e64a8458be190182f166e Mon Sep 17 00:00:00 2001 From: DanielEliraz Date: Sun, 24 Apr 2022 16:28:44 +0300 Subject: [PATCH] FIX #835: null mNotification (#862) --- .../wix/reactnativenotifications/RNNotificationsModule.java | 4 +++- .../core/ReactAppLifecycleFacade.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java b/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java index db9eabaa4..90969b273 100644 --- a/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java +++ b/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java @@ -88,8 +88,10 @@ public void getInitialNotification(final Promise promise) { return; } - InitialNotificationHolder.getInstance().clear(); result = Arguments.fromBundle(notification.asBundle()); + InitialNotificationHolder.getInstance().clear(); + } catch (NullPointerException e) { + Log.e(LOGTAG, "getInitialNotification: Null pointer exception"); } finally { promise.resolve(result); } diff --git a/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/ReactAppLifecycleFacade.java b/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/ReactAppLifecycleFacade.java index fae61575d..91c714195 100644 --- a/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/ReactAppLifecycleFacade.java +++ b/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/ReactAppLifecycleFacade.java @@ -47,7 +47,7 @@ public synchronized boolean isReactInitialized() { return false; } - return mReactContext.hasActiveCatalystInstance(); + return mReactContext.hasActiveReactInstance(); } @Override