Check that size is number, not truthiness of size
This commit is contained in:
parent
a74070f4ed
commit
72bb01346f
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
import Long from 'long';
|
||||
import { ReceiptCredentialPresentation } from '@signalapp/libsignal-client/zkgroup';
|
||||
import { isNumber } from 'lodash';
|
||||
|
||||
import { assert, strictAssert } from '../util/assert';
|
||||
import { dropNull, shallowDropNull } from '../util/dropNull';
|
||||
|
@ -50,7 +51,7 @@ export function processAttachment(
|
|||
const hasCdnId = Long.isLong(cdnId) ? !cdnId.isZero() : Boolean(cdnId);
|
||||
|
||||
const { contentType, digest, key, size } = attachment;
|
||||
if (!size) {
|
||||
if (!isNumber(size)) {
|
||||
throw new Error('Missing size on incoming attachment!');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue