Skip to content

Commit

Permalink
address code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Nov 7, 2024
1 parent 9f4def3 commit e40a090
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -2293,9 +2293,9 @@ Query.prototype.mongooseOptions = function(v) {

Query.prototype._castConditions = function() {
let sanitizeFilterOpt = undefined;
if (this.model != null && this.model.db.options?.sanitizeFilter != null) {
if (this.model?.db.options?.sanitizeFilter != null) {
sanitizeFilterOpt = this.model.db.options.sanitizeFilter;
} else if (this.model != null && this.model.base.options?.sanitizeFilter != null) {
} else if (this.model?.base.options?.sanitizeFilter != null) {
sanitizeFilterOpt = this.model.base.options.sanitizeFilter;
} else {
sanitizeFilterOpt = this._mongooseOptions.sanitizeFilter;
Expand Down

0 comments on commit e40a090

Please sign in to comment.