diff --git a/lib/schema/boolean.js b/lib/schema/boolean.js index eb904ccd34e..37b4d51e0a0 100644 --- a/lib/schema/boolean.js +++ b/lib/schema/boolean.js @@ -237,7 +237,7 @@ SchemaBoolean.prototype._castNullish = function _castNullish(v) { this.constructor.cast() : SchemaBoolean.cast(); if (castBoolean == null) { - return null; + return v; } if (castBoolean.convertToFalse instanceof Set && castBoolean.convertToFalse.has(v)) { return false; @@ -245,7 +245,7 @@ SchemaBoolean.prototype._castNullish = function _castNullish(v) { if (castBoolean.convertToTrue instanceof Set && castBoolean.convertToTrue.has(v)) { return true; } - return null; + return v; }; /*!