Skip to content

Commit b9136c1

Browse files
authored
Merge pull request Automattic#15104 from Automattic/vkarpov15/Automatticgh-15022
refactor(query): simplify CastError check
2 parents 341b238 + 51253b8 commit b9136c1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/query.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,10 +2247,7 @@ Query.prototype.error = function error(err) {
22472247
*/
22482248

22492249
Query.prototype._unsetCastError = function _unsetCastError() {
2250-
if (this._error == null) {
2251-
return;
2252-
}
2253-
if (this._error != null && !(this._error instanceof CastError)) {
2250+
if (this._error == null || !(this._error instanceof CastError)) {
22542251
return;
22552252
}
22562253
return this.error(null);

0 commit comments

Comments
 (0)