From b5caeee7fc1bdec2f37c4ba641bf419997a0ade7 Mon Sep 17 00:00:00 2001 From: some random guy Date: Tue, 8 Mar 2022 21:43:17 +0100 Subject: [PATCH] Fix board settings save with empty custom css `empty_string && something` is empty string, which fails the `=== false` check in checkSchema. --- helpers/schema.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/schema.js b/helpers/schema.js index da89be38..0644ffcb 100644 --- a/helpers/schema.js +++ b/helpers/schema.js @@ -49,12 +49,12 @@ module.exports = { //check if value is included in a set or array, usually for blacklist or whitelist inArrayBody: (data, list) => { - return data && list[list.constructor.name === 'Array' ? 'includes' : 'has'](data); + return data !== null && list[list.constructor.name === 'Array' ? 'includes' : 'has'](data); }, //the opposite kinda, check if the data includes any of the values in the array arrayInBody: (filters, data) => { - return data && filters.some(filter => data.includes(filter)); + return data !== null && filters.some(filter => data.includes(filter)); }, //check the actual schema