From dcb11027468875b88c36bf6b1eb0e5a544aa6db7 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 14 Jun 2019 08:05:28 -0400 Subject: [PATCH] crash fixes --- src/App/Pages/Vault/AddEditPageViewModel.cs | 4 ++-- src/App/Pages/Vault/AutofillCiphersPageViewModel.cs | 4 ++++ src/App/Services/MobilePlatformUtilsService.cs | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/App/Pages/Vault/AddEditPageViewModel.cs b/src/App/Pages/Vault/AddEditPageViewModel.cs index 05fa9a68d..8db051bd7 100644 --- a/src/App/Pages/Vault/AddEditPageViewModel.cs +++ b/src/App/Pages/Vault/AddEditPageViewModel.cs @@ -381,10 +381,10 @@ namespace Bit.App.Pages return false; } - Cipher.Fields = Fields.Any() ? Fields.Select(f => f.Field).ToList() : null; + Cipher.Fields = Fields != null && Fields.Any() ? Fields.Select(f => f.Field).ToList() : null; if(Cipher.Login != null) { - Cipher.Login.Uris = Uris.ToList(); + Cipher.Login.Uris = Uris?.ToList(); if(!EditMode && Cipher.Type == CipherType.Login && (Cipher.Login.Uris?.Count ?? 0) == 1 && string.IsNullOrWhiteSpace(Cipher.Login.Uris.First().Uri)) { diff --git a/src/App/Pages/Vault/AutofillCiphersPageViewModel.cs b/src/App/Pages/Vault/AutofillCiphersPageViewModel.cs index 951fad9d6..b3bd1eb33 100644 --- a/src/App/Pages/Vault/AutofillCiphersPageViewModel.cs +++ b/src/App/Pages/Vault/AutofillCiphersPageViewModel.cs @@ -112,6 +112,10 @@ namespace Bit.App.Pages public async Task SelectCipherAsync(CipherView cipher, bool fuzzy) { + if(cipher == null) + { + return; + } if(_deviceActionService.SystemMajorVersion() < 21) { await AppHelpers.CipherListOptions(Page, cipher); diff --git a/src/App/Services/MobilePlatformUtilsService.cs b/src/App/Services/MobilePlatformUtilsService.cs index d21a8a651..cdf9653d4 100644 --- a/src/App/Services/MobilePlatformUtilsService.cs +++ b/src/App/Services/MobilePlatformUtilsService.cs @@ -94,7 +94,11 @@ namespace Bit.App.Services if((uri.StartsWith("http://") || uri.StartsWith("https://")) && Uri.TryCreate(uri, UriKind.Absolute, out var parsedUri)) { - Browser.OpenAsync(uri, BrowserLaunchMode.External); + try + { + Browser.OpenAsync(uri, BrowserLaunchMode.External); + } + catch(FeatureNotSupportedException) { } } else {