diff --git a/lib/query.js b/lib/query.js index 4a4dc5aca0..067a6e020e 100644 --- a/lib/query.js +++ b/lib/query.js @@ -2247,10 +2247,7 @@ Query.prototype.error = function error(err) { */ Query.prototype._unsetCastError = function _unsetCastError() { - if (this._error == null) { - return; - } - if (this._error != null && !(this._error instanceof CastError)) { + if (this._error == null || !(this._error instanceof CastError)) { return; } return this.error(null);