From cf9947e47b610793a786f70403020ed6c3db9e37 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 20 Nov 2017 11:28:06 -0500 Subject: [PATCH] attachments length check --- src/models/domain/cipher.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/domain/cipher.ts b/src/models/domain/cipher.ts index 80fd5d62d8..cfc9aff4f8 100644 --- a/src/models/domain/cipher.ts +++ b/src/models/domain/cipher.ts @@ -155,7 +155,7 @@ class Cipher extends Domain { const orgId = this.organizationId; - if (this.attachments != null) { + if (this.attachments != null && this.attachments.length > 0) { const attachments: any[] = []; await this.attachments.reduce((promise, attachment) => { return promise.then(() => { @@ -167,7 +167,7 @@ class Cipher extends Domain { model.attachments = attachments; } - if (this.fields != null) { + if (this.fields != null && this.fields.length > 0) { const fields: any[] = []; await this.fields.reduce((promise, field) => { return promise.then(() => {