From 310d51d859e0e0a66242b05b7f4def4a6edb658d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 3 Jan 2018 17:07:33 -0500 Subject: [PATCH] handle null conditions from action sheet --- src/App/Pages/Settings/SettingsPage.cs | 6 +++++- src/App/Utilities/Helpers.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/App/Pages/Settings/SettingsPage.cs b/src/App/Pages/Settings/SettingsPage.cs index df21455e1..2bdd9c375 100644 --- a/src/App/Pages/Settings/SettingsPage.cs +++ b/src/App/Pages/Settings/SettingsPage.cs @@ -285,7 +285,7 @@ namespace Bit.App.Pages AppResources.LockOptionImmediately, AppResources.LockOption1Minute, AppResources.LockOption15Minutes, AppResources.LockOption1Hour, AppResources.LockOption4Hours, AppResources.Never); - if(selection == AppResources.Cancel) + if(selection == null || selection == AppResources.Cancel) { return; } @@ -314,6 +314,10 @@ namespace Bit.App.Pages { _settings.AddOrUpdateValue(Constants.SettingLockSeconds, -1); } + else + { + return; + } LockOptionsCell.Detail = selection; } diff --git a/src/App/Utilities/Helpers.cs b/src/App/Utilities/Helpers.cs index 3b545217a..db69fc08c 100644 --- a/src/App/Utilities/Helpers.cs +++ b/src/App/Utilities/Helpers.cs @@ -167,7 +167,7 @@ namespace Bit.App.Utilities AppResources.TypeLogin, AppResources.TypeCard, AppResources.TypeIdentity, AppResources.TypeSecureNote); var selectedType = CipherType.SecureNote; - if(type == AppResources.Cancel) + if(type == null || type == AppResources.Cancel) { return; } @@ -183,6 +183,10 @@ namespace Bit.App.Utilities { selectedType = CipherType.Identity; } + else + { + return; + } var addPage = new VaultAddCipherPage(selectedType, defaultFolderId: folderId); await page.Navigation.PushForDeviceAsync(addPage);