From e90f0c7fb179c19ccee22b01cc8077cdd009c49a Mon Sep 17 00:00:00 2001 From: neauoire Date: Sun, 10 Nov 2019 09:15:28 -0500 Subject: Catch invalid colors --- editor/scripts/lib/theme.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'editor/scripts') 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 } -- cgit v1.2.3