Skip to content

Prevent exception if "from" clause references an undefined property. #89

@atrniv

Description

@atrniv

Currently nools throws an exception if the from clause references an key which does not exist on an object.
I think it would be much more useful if nools simply considers the check condition as false instead of throwing an error.
This could be useful in situation where the object being checked changes structure.

The workaround I use for this situation is to check that the key exists in a condition before the check with the from clause.

Eg:

Ideal scenario : Right now this throws an error if property does not exist

[Item, "foo"]
[Object, "property", "property > 10", "from foo.property"]

Workaround

[Item, "foo", "isDefined('property')"]
[Object, "property", "property > 10", "from foo.property"]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions