Skip to content

Commit 6a09f17

Browse files
author
Marvel Mathew
committed
Handle where val might be null or undefined
1 parent 5e503d1 commit 6a09f17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Adapters/Storage/Mongo/MongoTransform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ function transformConstraint(constraint, field) {
665665
case '$ne':
666666
case '$eq': {
667667
const val = constraint[key];
668-
if (key !== '$exists' && typeof val === 'object' && val.$relativeTime) {
668+
if (key !== '$exists' && val && typeof val === 'object' && val.$relativeTime) {
669669
const parserResult = relativeTimeToDate(val.$relativeTime);
670670
if (parserResult.status === 'success') {
671671
answer[key] = parserResult.result;

0 commit comments

Comments
 (0)