Allow for zero-size attachments in maximum size calculation
This commit is contained in:
parent
e7dbdeb9c2
commit
e5e4c1aa3e
1 changed files with 1 additions and 1 deletions
|
@ -289,7 +289,7 @@ async function _runJob(job?: AttachmentDownloadJobType): Promise<void> {
|
|||
const { size } = attachment;
|
||||
const sizeInKib = size / KIBIBYTE;
|
||||
|
||||
if (!size || sizeInKib > maxInKib) {
|
||||
if (!Number.isFinite(size) || size < 0 || sizeInKib > maxInKib) {
|
||||
throw new AttachmentSizeError(
|
||||
`Attachment Job ${id}: Attachment was ${sizeInKib}kib, max is ${maxInKib}kib`
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue