camunda / feel-scala

FEEL parser and interpreter written in Scala
https://camunda.github.io/feel-scala/
Apache License 2.0
119 stars 46 forks source link

List filter expression throws error if list is null #809

Open jonathanlukas opened 4 months ago

jonathanlukas commented 4 months ago

Describe the bug

If I try to filter a list that does not exist (is null), the expression will throw an error like:

failed to evaluate expression 'partner[item.nummer = "1"]': Expected list but found 'null'

Also, there are warnings that represent the same:

* [NO_VARIABLE_FOUND] No variable found with name 'partner'
* [INVALID_TYPE] Expected list but found 'null'

To Reproduce

  1. Use https://camunda.github.io/feel-scala/docs/playground/
  2. Set expression to: partner[item.nummer = "1"]
  3. Hit evaluate

Expected behavior

The result should be null, the warnings are fine

Environment

saig0 commented 4 months ago

@jonathanlukas thank you for reporting. :+1: I agree that the expression should return null instead.