mirror of
https://github.com/bitwarden/mobile.git
synced 2024-12-26 16:57:59 +01:00
Don't break when CipherType data is null (#1008)
as explained in issue https://github.com/bitwarden/mobile/issues/1006
This commit is contained in:
parent
ff322cd2dd
commit
cf6021d898
@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
@ -25,6 +26,8 @@ namespace Bit.Core.Models.Data
|
||||
Notes = response.Notes;
|
||||
CollectionIds = collectionIds?.ToList() ?? response.CollectionIds;
|
||||
|
||||
try // Added to address Issue (https://github.com/bitwarden/mobile/issues/1006)
|
||||
{
|
||||
switch (Type)
|
||||
{
|
||||
case Enums.CipherType.Login:
|
||||
@ -42,6 +45,17 @@ namespace Bit.Core.Models.Data
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
System.Diagnostics.Trace.WriteLine(new StringBuilder()
|
||||
.Append("BitWarden CipherData constructor failed to initialize CyperType '")
|
||||
.Append(Type)
|
||||
.Append("'; id = {")
|
||||
.Append(Id)
|
||||
.AppendLine("}")
|
||||
.ToString(), "BitWarden CipherData constructor");
|
||||
}
|
||||
|
||||
Fields = response.Fields?.Select(f => new FieldData(f)).ToList();
|
||||
Attachments = response.Attachments?.Select(a => new AttachmentData(a)).ToList();
|
||||
|
Loading…
Reference in New Issue
Block a user