From 596321078e3b9d9c113b5b03300f0d14cc737c06 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 23 Jan 2024 16:21:17 +0100 Subject: [PATCH] wait #6661 @0.25 --- src/resources/views/when.blade.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/resources/views/when.blade.php b/src/resources/views/when.blade.php index 4bdb8be..99d17ec 100644 --- a/src/resources/views/when.blade.php +++ b/src/resources/views/when.blade.php @@ -81,14 +81,21 @@ }; function checkCondition(condition, operator, val) { - if (condition.id === '_not_empty_' || condition.operator === 'not_empty') { - return val.toString().length > 0; - } - if (operator === '=') { - return condition.id == val; - } - if (operator === '!=' || operator === '!') { - return condition.id != val; + try { + if (condition.id === undefined) { + condition.id = ''; + } + if (condition.id === '_not_empty_' || condition.operator === 'not_empty') { + return val.toString().length > 0; + } + if (operator === '=') { + return condition.id == val; + } + if (operator === '!=' || operator === '!') { + return condition.id != val; + } + } catch (e) { + return true; } } @@ -125,6 +132,9 @@ if (!isObject(condition)) { condition = {id: condition}; } + if (!condition.hasOwnProperty('id')) { + condition.id = ''; + } if (!condition.hasOwnProperty('order')) { condition.order = k; } -- 2.39.5