Skip to content

Commit

Permalink
Merge pull request #15104 from Automattic/vkarpov15/gh-15022
Browse files Browse the repository at this point in the history
refactor(query): simplify CastError check
  • Loading branch information
vkarpov15 authored Dec 17, 2024
2 parents 341b238 + 51253b8 commit b9136c1
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 b9136c1

Please sign in to comment.