You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When a definition of type object specifies required properties, passing in null to the validate method throws a TypeError: Cannot read property 'hasOwnProperty' of null.
Steps to reproduce
constschema={def: {type: 'object',properties: {foo: {type: 'string'}},required: ['foo'],},};constenv=djv();env.addSchema('test',schema);constobj=null;consterrors=env.validate('test#/def',obj);// should return the errors object
Expected behaviour
The validation fails and errors is populated with the validation error.
Actual behaviour TypeError: Cannot read property 'hasOwnProperty' of null is thrown.
Version
2.1.1
The text was updated successfully, but these errors were encountered:
Description
When a definition of type
object
specifies required properties, passing innull
to thevalidate
method throws aTypeError: Cannot read property 'hasOwnProperty' of null
.Steps to reproduce
Expected behaviour
The validation fails and
errors
is populated with the validation error.Actual behaviour
TypeError: Cannot read property 'hasOwnProperty' of null
is thrown.Version
2.1.1
The text was updated successfully, but these errors were encountered: