diff --git a/index.js b/index.js index 397e6b2..b705a24 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ function containsRules(rules) { } module.exports = function hasShape(rules) { - return combinator((object, applyValidators, context) => { + let validator = combinator((object, applyValidators, context) => { let allowExtraProperties = defaultValue(context.allowExtraProperties, false); let unexpectedPropertyErrors = asExpression(() => { @@ -80,4 +80,8 @@ module.exports = function hasShape(rules) { }); } }); + + validator.callIfNull = false; + + return validator; };