cqframework/cql-execution

Query ByExpression does not check for null values.

dwwinters opened this issue · 3 comments

https://github.com/cqframework/cql-execution/blob/master/src/elm/query.js#L96

If either a_val or b_val are null, then checking .isQuantity will result in an error.

Suggest changing to ?.isQuantity for safety. Let me know if you want me to submit a PR that makes this change.

Sure, I'll take a PR! But... optional chaining (.?) was only introduced in Node 14. This project doesn't declare a specific version of Node.js, but is generally expected to work with Node 12 (maintenance LTS). So... I'd ask you do checks via (== null / != null) rather than ?..

I have a local fix for this which I will include in an upcoming PR soon.

This fix is now available in the cql-execution 2.3.3 release.