From 1873c75a7fe068b80471544fbe114801a9cde658 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 29 Oct 2024 23:55:44 +0200 Subject: [PATCH] don't shit the bed if can't find a color --- .../settings_modal/tabs/style_tab/style_tab.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/settings_modal/tabs/style_tab/style_tab.js b/src/components/settings_modal/tabs/style_tab/style_tab.js index 343b56aa..cba21a0c 100644 --- a/src/components/settings_modal/tabs/style_tab/style_tab.js +++ b/src/components/settings_modal/tabs/style_tab/style_tab.js @@ -523,9 +523,14 @@ export default { }) exports.computeColor = (color) => { - const computedColor = findColor(color, { dynamicVars: dynamicVars.value, staticVars: staticVars.value }) - if (computedColor) { - return rgb2hex(computedColor) + let computedColor + try { + computedColor = findColor(color, { dynamicVars: dynamicVars.value, staticVars: staticVars.value }) + if (computedColor) { + return rgb2hex(computedColor) + } + } catch (e) { + console.warn(e) } return null }