From e40a09064bfd8cfcc99008a601f001c91684d4c3 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Thu, 7 Nov 2024 09:36:51 -0500 Subject: [PATCH] address code review comments --- lib/query.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/query.js b/lib/query.js index 212cffd794..99a67d55dd 100644 --- a/lib/query.js +++ b/lib/query.js @@ -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;