handle null conditions from action sheet

This commit is contained in:
Kyle Spearrin 2018-01-03 17:07:33 -05:00
parent cf9e820227
commit 310d51d859
2 changed files with 10 additions and 2 deletions

View file

@ -285,7 +285,7 @@ namespace Bit.App.Pages
AppResources.LockOptionImmediately, AppResources.LockOption1Minute, AppResources.LockOption15Minutes, AppResources.LockOptionImmediately, AppResources.LockOption1Minute, AppResources.LockOption15Minutes,
AppResources.LockOption1Hour, AppResources.LockOption4Hours, AppResources.Never); AppResources.LockOption1Hour, AppResources.LockOption4Hours, AppResources.Never);
if(selection == AppResources.Cancel) if(selection == null || selection == AppResources.Cancel)
{ {
return; return;
} }
@ -314,6 +314,10 @@ namespace Bit.App.Pages
{ {
_settings.AddOrUpdateValue(Constants.SettingLockSeconds, -1); _settings.AddOrUpdateValue(Constants.SettingLockSeconds, -1);
} }
else
{
return;
}
LockOptionsCell.Detail = selection; LockOptionsCell.Detail = selection;
} }

View file

@ -167,7 +167,7 @@ namespace Bit.App.Utilities
AppResources.TypeLogin, AppResources.TypeCard, AppResources.TypeIdentity, AppResources.TypeSecureNote); AppResources.TypeLogin, AppResources.TypeCard, AppResources.TypeIdentity, AppResources.TypeSecureNote);
var selectedType = CipherType.SecureNote; var selectedType = CipherType.SecureNote;
if(type == AppResources.Cancel) if(type == null || type == AppResources.Cancel)
{ {
return; return;
} }
@ -183,6 +183,10 @@ namespace Bit.App.Utilities
{ {
selectedType = CipherType.Identity; selectedType = CipherType.Identity;
} }
else
{
return;
}
var addPage = new VaultAddCipherPage(selectedType, defaultFolderId: folderId); var addPage = new VaultAddCipherPage(selectedType, defaultFolderId: folderId);
await page.Navigation.PushForDeviceAsync(addPage); await page.Navigation.PushForDeviceAsync(addPage);