diff --git a/src/Utils/messages-media.ts b/src/Utils/messages-media.ts index 9cf21a9..26b6bc3 100644 --- a/src/Utils/messages-media.ts +++ b/src/Utils/messages-media.ts @@ -111,7 +111,7 @@ export const extractImageThumb = async(bufferOrFilePath: Readable | Buffer | str height: dimensions.height, }, } - } else if('jimp' in lib && typeof lib.jimp.read === 'function') { + } else if('jimp' in lib && typeof lib.jimp?.read === 'function') { const { read, MIME_JPEG, RESIZE_BILINEAR, AUTO } = lib.jimp const jimp = await read(bufferOrFilePath as any) @@ -160,7 +160,7 @@ export const generateProfilePicture = async(mediaUpload: WAMediaUpload) => { quality: 50, }) .toBuffer() - } else if('jimp' in lib && typeof lib.jimp.read === 'function') { + } else if('jimp' in lib && typeof lib.jimp?.read === 'function') { const { read, MIME_JPEG, RESIZE_BILINEAR } = lib.jimp const jimp = await read(bufferOrFilePath as any) const min = Math.min(jimp.getWidth(), jimp.getHeight())