Skip to content

Commit f6f6a3b

Browse files
committed
Use a little more robust method of checking instances
1 parent ef60987 commit f6f6a3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/validate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O
208208

209209
for(var i in objTypeDef){
210210
if(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){
211-
var value = instance[i];
211+
var value = instance.hasOwnProperty(i) ? instance[i] : undefined;
212212
// skip _not_ specified properties
213213
if (value === undefined && options.existingOnly) continue;
214214
var propDef = objTypeDef[i];

0 commit comments

Comments
 (0)