From 2467d5a8a7b68cbba01e61ad33d640e65a5a6cb5 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 13:57:42 +0000 Subject: [PATCH] feat: gracefully handle missing background themes Fallback to a hardcoded default theme instead of returning null when the configured theme and the 'classic' fallback are both missing. This prevents potential UI glitches. --- js/background-themes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/background-themes.js b/js/background-themes.js index bb2cfe7..9727a78 100644 --- a/js/background-themes.js +++ b/js/background-themes.js @@ -1549,10 +1549,10 @@ function getGradient(ctx, height) { return cachedGradient; } - const theme = BACKGROUND_THEMES[colorTheme] || BACKGROUND_THEMES.classic; + let theme = BACKGROUND_THEMES[colorTheme] || BACKGROUND_THEMES.classic; if (!theme) { - console.warn("No theme found for", colorTheme); - return null; + console.warn("No theme found for", colorTheme, "- falling back to default"); + theme = { top: '#05004c', bottom: '#110E19', star: '#ffffff' }; } const gradient = ctx.createLinearGradient(0, 0, 0, height);