};
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;
}
}
if (!isObject(condition)) {
condition = {id: condition};
}
+ if (!condition.hasOwnProperty('id')) {
+ condition.id = '';
+ }
if (!condition.hasOwnProperty('order')) {
condition.order = k;
}