null checks

This commit is contained in:
Kyle Spearrin 2019-05-09 17:27:43 -04:00
parent 3bd01067e3
commit a535e8a82b
2 changed files with 4 additions and 4 deletions

View file

@ -313,11 +313,11 @@ namespace Bit.App.Pages
FolderSelectedIndex = string.IsNullOrWhiteSpace(Cipher.FolderId) ? FolderOptions.Count - 1 : FolderSelectedIndex = string.IsNullOrWhiteSpace(Cipher.FolderId) ? FolderOptions.Count - 1 :
FolderOptions.FindIndex(k => k.Value == Cipher.FolderId); FolderOptions.FindIndex(k => k.Value == Cipher.FolderId);
CardBrandSelectedIndex = string.IsNullOrWhiteSpace(Cipher?.Card.Brand) ? 0 : CardBrandSelectedIndex = string.IsNullOrWhiteSpace(Cipher.Card?.Brand) ? 0 :
CardBrandOptions.FindIndex(k => k.Value == Cipher.Card.Brand); CardBrandOptions.FindIndex(k => k.Value == Cipher.Card.Brand);
CardExpMonthSelectedIndex = string.IsNullOrWhiteSpace(Cipher?.Card.ExpMonth) ? 0 : CardExpMonthSelectedIndex = string.IsNullOrWhiteSpace(Cipher.Card?.ExpMonth) ? 0 :
CardExpMonthOptions.FindIndex(k => k.Value == Cipher.Card.ExpMonth); CardExpMonthOptions.FindIndex(k => k.Value == Cipher.Card.ExpMonth);
IdentityTitleSelectedIndex = string.IsNullOrWhiteSpace(Cipher?.Identity.Title) ? 0 : IdentityTitleSelectedIndex = string.IsNullOrWhiteSpace(Cipher.Identity?.Title) ? 0 :
IdentityTitleOptions.FindIndex(k => k.Value == Cipher.Identity.Title); IdentityTitleOptions.FindIndex(k => k.Value == Cipher.Identity.Title);
OwnershipSelectedIndex = string.IsNullOrWhiteSpace(Cipher.OrganizationId) ? 0 : OwnershipSelectedIndex = string.IsNullOrWhiteSpace(Cipher.OrganizationId) ? 0 :
OwnershipOptions.FindIndex(k => k.Value == Cipher.OrganizationId); OwnershipOptions.FindIndex(k => k.Value == Cipher.OrganizationId);

View file

@ -27,7 +27,7 @@ namespace Bit.Core.Models.Domain
OrganizationUseTotp = obj.OrganizationUseTotp; OrganizationUseTotp = obj.OrganizationUseTotp;
Edit = obj.Edit; Edit = obj.Edit;
RevisionDate = obj.RevisionDate; RevisionDate = obj.RevisionDate;
CollectionIds = new HashSet<string>(obj.CollectionIds); CollectionIds = obj.CollectionIds != null ? new HashSet<string>(obj.CollectionIds) : null;
LocalData = localData; LocalData = localData;
switch(Type) switch(Type)