mirror of
https://github.com/directus/directus.git
synced 2026-01-28 17:28:06 -05:00
Stop app crashing when rule is configured incorrectly (#7574)
* catch the error instead of crashing the app if validatePayload fails * Don't attempt validatePayload with invalid rule Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -237,8 +237,10 @@ export default defineComponent({
|
||||
const conditions = [...field.meta.conditions].reverse();
|
||||
|
||||
const matchingCondition = conditions.find((condition) => {
|
||||
if (!condition.rule) return;
|
||||
if (!condition.rule || Object.keys(condition.rule).length !== 1) return;
|
||||
|
||||
const errors = validatePayload(condition.rule, values.value, { requireAll: true });
|
||||
|
||||
return errors.length === 0;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user