null checks

This commit is contained in:
Kyle Spearrin 2019-06-15 00:14:32 -04:00
parent 61b728fea7
commit 58ef292fa7

View file

@ -367,6 +367,10 @@ namespace Bit.App.Pages
public async Task<bool> SubmitAsync() public async Task<bool> SubmitAsync()
{ {
if(Cipher == null)
{
return false;
}
if(Xamarin.Essentials.Connectivity.NetworkAccess == Xamarin.Essentials.NetworkAccess.None) if(Xamarin.Essentials.Connectivity.NetworkAccess == Xamarin.Essentials.NetworkAccess.None)
{ {
await _platformUtilsService.ShowDialogAsync(AppResources.InternetConnectionRequiredMessage, await _platformUtilsService.ShowDialogAsync(AppResources.InternetConnectionRequiredMessage,
@ -406,6 +410,10 @@ namespace Bit.App.Pages
} }
var cipher = await _cipherService.EncryptAsync(Cipher); var cipher = await _cipherService.EncryptAsync(Cipher);
if(cipher == null)
{
return false;
}
try try
{ {
await _deviceActionService.ShowLoadingAsync(AppResources.Saving); await _deviceActionService.ShowLoadingAsync(AppResources.Saving);