aboutsummaryrefslogtreecommitdiff
path: root/editor/scripts
diff options
context:
space:
mode:
authorneauoire <aliceffekt@gmail.com>2019-11-10 09:15:28 -0500
committerneauoire <aliceffekt@gmail.com>2019-11-10 09:15:28 -0500
commite90f0c7fb179c19ccee22b01cc8077cdd009c49a (patch)
treed958bd543aac47c67882556bda56d751599eb8a0 /editor/scripts
parent2c7becbe4b0defa6a6e80d46ca312fd028f1075d (diff)
Catch invalid colors
Diffstat (limited to 'editor/scripts')
-rw-r--r--editor/scripts/lib/theme.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/editor/scripts/lib/theme.js b/editor/scripts/lib/theme.js
index 85fcc63..e218392 100644
--- a/editor/scripts/lib/theme.js
+++ b/editor/scripts/lib/theme.js
@@ -144,15 +144,15 @@ function Theme (client) {
function isValid (json) {
if (!json) { return false }
- if (!json.background) { return false }
- if (!json.f_high) { return false }
- if (!json.f_med) { return false }
- if (!json.f_low) { return false }
- if (!json.f_inv) { return false }
- if (!json.b_high) { return false }
- if (!json.b_med) { return false }
- if (!json.b_low) { return false }
- if (!json.b_inv) { return false }
+ if (!json.background || !isColor(json.background)) { return false }
+ if (!json.f_high || !isColor(json.f_high)) { return false }
+ if (!json.f_med || !isColor(json.f_med)) { return false }
+ if (!json.f_low || !isColor(json.f_low)) { return false }
+ if (!json.f_inv || !isColor(json.f_inv)) { return false }
+ if (!json.b_high || !isColor(json.b_high)) { return false }
+ if (!json.b_med || !isColor(json.b_med)) { return false }
+ if (!json.b_low || !isColor(json.b_low)) { return false }
+ if (!json.b_inv || !isColor(json.b_inv)) { return false }
return true
}