editor: fix crash when theme.colors is undefined

This commit is contained in:
Abdullah Atta
2023-03-24 11:42:18 +05:00
committed by Abdullah Atta
parent 61b7e43d08
commit f1d4fd1d5d

View File

@@ -27,6 +27,7 @@ function isSchemeColor(
color: string, color: string,
theme: Theme theme: Theme
): color is keyof SchemeColors { ): color is keyof SchemeColors {
if (!theme || !theme.colors) return false;
return color in theme.colors; return color in theme.colors;
} }