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) { if(info && 'title' in info) {
const [image] = info.images const [image] = info.images
const jpegThumbnail = image let jpegThumbnail: Buffer | undefined = undefined
? await getCompressedJpegThumbnail(image, opts) try {
: undefined jpegThumbnail = image
? await getCompressedJpegThumbnail(image, opts)
: undefined
} catch(error) {
}
return { return {
'canonical-url': info.url, 'canonical-url': info.url,