From 8dd55dc80f3ab5711d2f3f485b721309352269b3 Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Wed, 20 Jan 2021 06:39:18 +1000 Subject: [PATCH] Add null check when getting attachment from item --- src/commands/get.command.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/get.command.ts b/src/commands/get.command.ts index bd05172e76..f4299461c4 100644 --- a/src/commands/get.command.ts +++ b/src/commands/get.command.ts @@ -253,7 +253,7 @@ export class GetCommand { } const cipher = await this.getCipherView(itemId); - if (cipher == null || Array.isArray(cipher) || cipher.attachments.length === 0) { + if (cipher == null || Array.isArray(cipher) || cipher.attachments == null || cipher.attachments.length === 0) { return Response.error('No attachments available for this item.'); }