1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-07-08 12:35:09 +02:00

attachments length check

This commit is contained in:
Kyle Spearrin 2017-11-20 11:28:06 -05:00
parent 89b300f268
commit cf9947e47b

View File

@ -155,7 +155,7 @@ class Cipher extends Domain {
const orgId = this.organizationId; const orgId = this.organizationId;
if (this.attachments != null) { if (this.attachments != null && this.attachments.length > 0) {
const attachments: any[] = []; const attachments: any[] = [];
await this.attachments.reduce((promise, attachment) => { await this.attachments.reduce((promise, attachment) => {
return promise.then(() => { return promise.then(() => {
@ -167,7 +167,7 @@ class Cipher extends Domain {
model.attachments = attachments; model.attachments = attachments;
} }
if (this.fields != null) { if (this.fields != null && this.fields.length > 0) {
const fields: any[] = []; const fields: any[] = [];
await this.fields.reduce((promise, field) => { await this.fields.reduce((promise, field) => {
return promise.then(() => { return promise.then(() => {