directus-extension-computed-interface icon indicating copy to clipboard operation
directus-extension-computed-interface copied to clipboard

fix: handle null emits

Open Guiqft opened this issue 3 years ago • 2 comments

This PR verifies when the parsed expression returns a empty value and properly emits null, so Directus can take care of the empty field.

Closes #7

Guiqft avatar Oct 14 '22 18:10 Guiqft

Now, this is the field behavior: ezgif-1-58331795ff

Guiqft avatar Oct 26 '22 03:10 Guiqft

Because all types are valid, even null (NULL & NOT_NULL operators), we cannot pre-check whether a value is valid or not. I think it is best to leave the responsibility of checking unintended values to the operators.

I still can't reproduce your issue with {{ MULTIPLY(numero,2) }}. It may be due to something else, because null * 2 is still 0, right?

duydvu avatar Oct 27 '22 03:10 duydvu