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.
This commit is contained in:
google-labs-jules[bot]
2026-01-09 13:57:42 +00:00
parent b6feb1c1b6
commit 2467d5a8a7
+3 -3
View File
@@ -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);