Merge pull request #217 from bitwarden/bugfix-no-attachments-error

Add null check when getting attachment from item
This commit is contained in:
Thomas Rittson 2021-01-29 08:50:24 +10:00 committed by GitHub
commit 38ead1888c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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.');
}