fix: crash in JumboCmd error handler

This commit is contained in:
Dragory 2023-07-01 11:32:59 +00:00
parent 0a3fe2d334
commit 8cee4ec1e4
No known key found for this signature in database

View file

@ -77,7 +77,13 @@ export const JumboCmd = utilityCmd({
} catch (err) {
if (url.toLocaleLowerCase().endsWith("fe0f.png")) {
url = url.slice(0, url.lastIndexOf("-fe0f")) + ".png";
image = await resizeBuffer(await getBufferFromUrl(url), size, size);
try {
image = resizeBuffer(await getBufferFromUrl(url), size, size);
} catch {
// It's fine if this fails, we just don't jumbo then.
// The errors here are usually some internal errors in the photon WASM code anyway,
// so we can't do anything about it.
}
}
}
if (!image) {