From 3f4d30ea32cb296475cb2c2cebf542d051f9430e Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Wed, 29 Dec 2021 23:30:16 +0530 Subject: [PATCH] fix: null check for app state subscription added --- src/libs/AppStateMonitor/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/AppStateMonitor/index.js b/src/libs/AppStateMonitor/index.js index 2410fb293865..0856f19e5b08 100644 --- a/src/libs/AppStateMonitor/index.js +++ b/src/libs/AppStateMonitor/index.js @@ -26,6 +26,9 @@ function addBecameActiveListener(callback) { } const appStateChangeSubscription = AppState.addEventListener('change', appStateChangeCallback); return () => { + if (!appStateChangeSubscription) { + return; + } appStateChangeSubscription.remove(); }; }