Skip to content

Commit

Permalink
refactor(query): simplify CastError check
Browse files Browse the repository at this point in the history
Re: comments on #15022
  • Loading branch information
vkarpov15 committed Dec 16, 2024
1 parent 2531768 commit 51253b8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 51253b8

Please sign in to comment.