Skip to content

Commit

Permalink
Handle where val might be null or undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvel Mathew committed Oct 24, 2017
1 parent 1cab841 commit 0ccf228
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Adapters/Storage/Mongo/MongoTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ function transformConstraint(constraint, field) {
case '$ne':
case '$eq': {
const val = constraint[key];
if (key !== '$exists' && typeof val === 'object' && val.$relativeTime) {
if (key !== '$exists' && val && typeof val === 'object' && val.$relativeTime) {
const parserResult = relativeTimeToDate(val.$relativeTime);
if (parserResult.status === 'success') {
answer[key] = parserResult.result;
Expand Down

0 comments on commit 0ccf228

Please sign in to comment.