fix: give preview even if thumbnail gen fails

This commit is contained in:
Adhiraj Singh
2022-06-09 15:07:04 +05:30
parent cea9e9da8a
commit be535f0a34

View File

@@ -36,9 +36,13 @@ export const getUrlInfo = async(
if(info && 'title' in info) {
const [image] = info.images
const jpegThumbnail = image
? await getCompressedJpegThumbnail(image, opts)
: undefined
let jpegThumbnail: Buffer | undefined = undefined
try {
jpegThumbnail = image
? await getCompressedJpegThumbnail(image, opts)
: undefined
} catch(error) {
}
return {
'canonical-url': info.url,