camunda/feel-scala

List filter expression throws error if list is null

Opened this issue · 1 comments

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

  • FEEL engine version: 1.17
  • Affects:
    • Camunda Connector Runtime 8.4.3

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