From d0bea58100761d4cd260b9313253784a46ea5483 Mon Sep 17 00:00:00 2001 From: Martin Drost Date: Wed, 14 Sep 2022 14:33:53 +0200 Subject: [PATCH] fix: allow null values inside $expr objects --- lib/helpers/query/cast$expr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/helpers/query/cast$expr.js b/lib/helpers/query/cast$expr.js index 677e77f65f7..f7c7fe0521f 100644 --- a/lib/helpers/query/cast$expr.js +++ b/lib/helpers/query/cast$expr.js @@ -77,8 +77,8 @@ module.exports = function cast$expr(val, schema, strictQuery) { }; function _castExpression(val, schema, strictQuery) { - if (isPath(val)) { - // Assume path + // Preserve the value if it represents a path or if it's null + if (isPath(val) || val === null) { return val; }