diff --git a/src/client/theme.ts b/src/client/theme.ts index e90c1f3a3b..cc69ee4060 100644 --- a/src/client/theme.ts +++ b/src/client/theme.ts @@ -104,8 +104,9 @@ function genValue(c: tinycolor.Instance): string { } export function validateTheme(theme: Record): boolean { - if (theme.id == null) return false; - if (theme.name == null) return false; + if (theme.id == null || typeof theme.id !== 'string') return false; + if (theme.name == null || typeof theme.name !== 'string') return false; if (theme.base == null || !['light', 'dark'].includes(theme.base)) return false; + if (theme.props == null || typeof theme.props !== 'object') return false; return true; }