From 8cee4ec1e4131b0d42d0025b56de52c660fc9b0e Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 1 Jul 2023 11:32:59 +0000 Subject: [PATCH] fix: crash in JumboCmd error handler --- backend/src/plugins/Utility/commands/JumboCmd.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/src/plugins/Utility/commands/JumboCmd.ts b/backend/src/plugins/Utility/commands/JumboCmd.ts index bbbcd50e..3dd1d30a 100644 --- a/backend/src/plugins/Utility/commands/JumboCmd.ts +++ b/backend/src/plugins/Utility/commands/JumboCmd.ts @@ -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) {