From 2a803bedcfd9afb1eec3ae0959f4c40d1dd51f9c Mon Sep 17 00:00:00 2001 From: Raul-Jaak-Ervin-Yks-Jalgvarav Date: Sat, 31 Aug 2019 21:31:38 +0300 Subject: [PATCH] fix object validation (#341) --- src/validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validator.js b/src/validator.js index 0fc3d180..a84f0922 100755 --- a/src/validator.js +++ b/src/validator.js @@ -206,7 +206,7 @@ Validator.prototype = { } for (var i = 0, l = keys.length; i < l; i++) { - if (Object.hasOwnProperty.call(copy, keys[i])) { + if (typeof copy === 'object' && copy !== null && Object.hasOwnProperty.call(copy, keys[i])) { copy = copy[keys[i]]; } else { return;