From a68c79979bdfdd19266d1321146354c4caa43e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Bispo?= Date: Mon, 5 Dec 2022 10:20:02 +0000 Subject: [PATCH] [SG-870] Add null check on notification received --- src/App/Services/PushNotificationListenerService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App/Services/PushNotificationListenerService.cs b/src/App/Services/PushNotificationListenerService.cs index cb7887fbffe..b08a43f1c15 100644 --- a/src/App/Services/PushNotificationListenerService.cs +++ b/src/App/Services/PushNotificationListenerService.cs @@ -141,7 +141,8 @@ await _syncService.Value.SyncUpsertFolderAsync(folderCreateUpdateMessage, } // if there is a request modal opened ignore all incoming requests - if (App.Current.MainPage.Navigation.ModalStack.Any(p => p is NavigationPage navPage && navPage.CurrentPage is LoginPasswordlessPage)) + // App.Current can be null if the app is killed + if (App.Current != null && App.Current.MainPage.Navigation.ModalStack.Any(p => p is NavigationPage navPage && navPage.CurrentPage is LoginPasswordlessPage)) { return; }