From 8cdb27fe43cde674aa93e8a5fc47cfc7b1b69006 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 1 Feb 2018 23:38:18 -0500 Subject: [PATCH] check modal stack before popping --- src/App/Pages/Lock/LockFingerprintPage.cs | 5 ++++- src/App/Pages/Lock/LockPasswordPage.cs | 5 ++++- src/App/Pages/Lock/LockPinPage.cs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/App/Pages/Lock/LockFingerprintPage.cs b/src/App/Pages/Lock/LockFingerprintPage.cs index 701b57d93..6e0ae7b42 100644 --- a/src/App/Pages/Lock/LockFingerprintPage.cs +++ b/src/App/Pages/Lock/LockFingerprintPage.cs @@ -119,7 +119,10 @@ namespace Bit.App.Pages if(result.Authenticated) { _appSettings.Locked = false; - await Navigation.PopModalAsync(); + if(Navigation.ModalStack.Count > 0) + { + await Navigation.PopModalAsync(); + } } else if(result.Status == FingerprintAuthenticationResultStatus.FallbackRequested) { diff --git a/src/App/Pages/Lock/LockPasswordPage.cs b/src/App/Pages/Lock/LockPasswordPage.cs index bbbe1b175..dad5eae6c 100644 --- a/src/App/Pages/Lock/LockPasswordPage.cs +++ b/src/App/Pages/Lock/LockPasswordPage.cs @@ -155,7 +155,10 @@ namespace Bit.App.Pages if(key.Key.SequenceEqual(_cryptoService.Key.Key)) { _appSettingsService.Locked = false; - await Navigation.PopModalAsync(); + if(Navigation.ModalStack.Count > 0) + { + await Navigation.PopModalAsync(); + } } else { diff --git a/src/App/Pages/Lock/LockPinPage.cs b/src/App/Pages/Lock/LockPinPage.cs index 75aab6d08..df21f499e 100644 --- a/src/App/Pages/Lock/LockPinPage.cs +++ b/src/App/Pages/Lock/LockPinPage.cs @@ -126,7 +126,10 @@ namespace Bit.App.Pages _appSettingsService.Locked = false; _appSettingsService.FailedPinAttempts = 0; PinControl.Entry.Unfocus(); - await Navigation.PopModalAsync(); + if(Navigation.ModalStack.Count > 0) + { + await Navigation.PopModalAsync(); + } } else {