From 690c058a4697ded1da1af0c5a7db97ea80c5b9ac Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 2 Dec 2023 00:04:38 +0200 Subject: [PATCH] Fix boolean comparison --- public/scripts/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scripts/utils.js b/public/scripts/utils.js index ee17c2c4a..b60446ee6 100644 --- a/public/scripts/utils.js +++ b/public/scripts/utils.js @@ -572,7 +572,7 @@ export function countOccurrences(string, character) { * @returns {boolean} True if the string is true, false otherwise. */ export function isTrueBoolean(arg) { - return ['on', 'true', '1'].includes(arg.trim().toLowerCase()); + return ['on', 'true', '1'].includes(arg?.trim()?.toLowerCase()); } /** @@ -581,7 +581,7 @@ export function isTrueBoolean(arg) { * @returns {boolean} True if the string is false, false otherwise. */ export function isFalseBoolean(arg) { - return ['off', 'false', '0'].includes(arg.trim().toLowerCase()); + return ['off', 'false', '0'].includes(arg?.trim()?.toLowerCase()); } /**