diff --git a/libs/common/src/vault/models/domain/cipher.ts b/libs/common/src/vault/models/domain/cipher.ts index b80f38f66af..c4ee35b2b8f 100644 --- a/libs/common/src/vault/models/domain/cipher.ts +++ b/libs/common/src/vault/models/domain/cipher.ts @@ -349,7 +349,7 @@ export class Cipher extends Domain implements Decryptable { */ toSdkCipher(): SdkCipher { const sdkCipher: SdkCipher = { - id: asUuid(this.id), + id: this.id ? asUuid(this.id) : undefined, organizationId: this.organizationId ? asUuid(this.organizationId) : undefined, folderId: this.folderId ? asUuid(this.folderId) : undefined, collectionIds: this.collectionIds ? this.collectionIds.map(asUuid) : ([] as any), diff --git a/libs/common/src/vault/models/view/cipher.view.ts b/libs/common/src/vault/models/view/cipher.view.ts index d52e6eb11bd..b9f717b3a7f 100644 --- a/libs/common/src/vault/models/view/cipher.view.ts +++ b/libs/common/src/vault/models/view/cipher.view.ts @@ -325,11 +325,11 @@ export class CipherView implements View, InitializerMetadata { name: this.name ?? "", notes: this.notes, type: this.type ?? CipherType.Login, - favorite: this.favorite, - organizationUseTotp: this.organizationUseTotp, + favorite: this.favorite ?? false, + organizationUseTotp: this.organizationUseTotp ?? false, permissions: this.permissions?.toSdkCipherPermissions(), - edit: this.edit, - viewPassword: this.viewPassword, + edit: this.edit ?? true, + viewPassword: this.viewPassword ?? true, localData: toSdkLocalData(this.localData), attachments: this.attachments?.map((a) => a.toSdkAttachmentView()), fields: this.fields?.map((f) => f.toSdkFieldView()),