diff --git a/src/Core/Pages/Vault/BaseCipherViewModel.cs b/src/Core/Pages/Vault/BaseCipherViewModel.cs index 7326872d8..671aca2a5 100644 --- a/src/Core/Pages/Vault/BaseCipherViewModel.cs +++ b/src/Core/Pages/Vault/BaseCipherViewModel.cs @@ -37,7 +37,7 @@ namespace Bit.App.Pages set => SetProperty(ref _cipher, value, additionalPropertyNames: AdditionalPropertiesToRaiseOnCipherChanged); } - public string CreationDate => string.Format(AppResources.CreatedXY, Cipher.CreationDate.ToShortDateString(), Cipher.CreationDate.ToShortTimeString()); + public string CreationDate => string.Format(AppResources.CreatedXY, Cipher?.CreationDate.ToShortDateString(), Cipher?.CreationDate.ToShortTimeString()); public AsyncCommand CheckPasswordCommand { get; } diff --git a/src/Core/Pages/Vault/CipherAddEditPage.xaml b/src/Core/Pages/Vault/CipherAddEditPage.xaml index 79b306e2a..1640f66d4 100644 --- a/src/Core/Pages/Vault/CipherAddEditPage.xaml +++ b/src/Core/Pages/Vault/CipherAddEditPage.xaml @@ -126,7 +126,7 @@ StyleClass="box-label" /> diff --git a/src/Core/Pages/Vault/CipherAddEditPageViewModel.cs b/src/Core/Pages/Vault/CipherAddEditPageViewModel.cs index bd34ca08f..ea68d137f 100644 --- a/src/Core/Pages/Vault/CipherAddEditPageViewModel.cs +++ b/src/Core/Pages/Vault/CipherAddEditPageViewModel.cs @@ -17,6 +17,8 @@ using Microsoft.Maui.Controls; using Microsoft.Maui; using Bit.App.Utilities; +#nullable enable + namespace Bit.App.Pages { public class CipherAddEditPageViewModel : BaseCipherViewModel @@ -883,7 +885,7 @@ namespace Bit.App.Pages Cipher.OrganizationId = OwnershipOptions[OwnershipSelectedIndex].Value; TriggerCipherChanged(); } - if (Cipher.OrganizationId != null) + if (Cipher?.OrganizationId != null) { var cols = _writeableCollections.Where(c => c.OrganizationId == Cipher.OrganizationId) .Select(c => new CollectionViewModel { Collection = c }).ToList();