Skip to content

Alternatives throw typeError when "is: null" is used #628

@svestka

Description

@svestka

I have schema like this, which worked without problems till version 6.1.0.

{
    param: Joi.boolean().when('param2', { is: null, then: Joi.forbidden() })
}

As of version 6.1.1 it start to throw TypeError:

TypeError: Cannot read property 'isJoi' of null
  at [object Object].internals.Alternatives.when (node_modules/joi/lib/alternatives.js:84:20)
  at [object Object].internals.Any.when (node_modules/joi/lib/any.js:360:28)

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions