Skip to content

Commit ae9f5de

Browse files
committed
[FIX] Fixed bug that caused error if an object was undefined
1 parent ec8ff1d commit ae9f5de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/suites/draft-04/keywords/required.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ module.exports = function(config) {
1010
var missing = [];
1111
for (var i = 0, len = config.schema.required.length; i !== len; ++i) {
1212
var prop = config.schema.required[i];
13+
14+
if (!config.inst) {
15+
config.inst = {};
16+
}
17+
1318
if (!Object.prototype.hasOwnProperty.call(config.inst, prop)) {
1419
missing.push(prop);
1520
}

0 commit comments

Comments
 (0)