joi icon indicating copy to clipboard operation
joi copied to clipboard

Alternatives throw typeError when "is: null" is used

Open svestka opened this issue 11 years ago • 1 comments

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)

svestka avatar Apr 13 '15 15:04 svestka

Thanks for the report, it's published.

Marsup avatar Apr 13 '15 16:04 Marsup