diff --git a/android/src/main/java/com/onesignal/rnonesignalandroid/RNOneSignal.java b/android/src/main/java/com/onesignal/rnonesignalandroid/RNOneSignal.java index 2371169e..d3c12115 100644 --- a/android/src/main/java/com/onesignal/rnonesignalandroid/RNOneSignal.java +++ b/android/src/main/java/com/onesignal/rnonesignalandroid/RNOneSignal.java @@ -165,6 +165,11 @@ private void removeObservers() { } private void removeHandlers() { + if(!oneSignalInitDone) { + Log.i("OneSignal", "OneSignal React-Native SDK not initialized yet. Could not remove handlers."); + return; + } + OneSignal.getInAppMessages().removeClickListener(rnInAppClickListener); hasAddedInAppMessageClickListener = false; OneSignal.getInAppMessages().removeLifecycleListener(rnInAppLifecycleListener);