From f3eb1fbeb31228267b194f54afa6722af856697e Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sun, 22 Sep 2024 15:43:02 +1200 Subject: [PATCH] Fix not matching all errors in catch block --- src/d2m/actions/expression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d2m/actions/expression.js b/src/d2m/actions/expression.js index b81f4ed8..fd75aa5b 100644 --- a/src/d2m/actions/expression.js +++ b/src/d2m/actions/expression.js @@ -30,7 +30,7 @@ async function emojisToState(emojis) { } db.prepare("INSERT OR IGNORE INTO emoji (emoji_id, name, animated, mxc_url) VALUES (?, ?, ?, ?)").run(emoji.id, emoji.name, +!!emoji.animated, url) }).catch(e => { - if (e.data.errcode === "M_TOO_LARGE") { // Very unlikely to happen. Only possible for 3x-series emojis uploaded shortly after animated emojis were introduced, when there was no 256 KB size limit. + if (e.data?.errcode === "M_TOO_LARGE") { // Very unlikely to happen. Only possible for 3x-series emojis uploaded shortly after animated emojis were introduced, when there was no 256 KB size limit. return } console.error(`Trying to handle emoji ${emoji.name} (${emoji.id}), but...`)