Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
svestka opened this issue Apr 13, 2015 · 1 comment
Closed

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

svestka opened this issue Apr 13, 2015 · 1 comment
Assignees
Labels
bug Bug or defect
Milestone

Comments

@svestka
Copy link

svestka commented Apr 13, 2015

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)
@Marsup Marsup added the bug Bug or defect label Apr 13, 2015
@Marsup Marsup self-assigned this Apr 13, 2015
@Marsup Marsup added this to the 6.1.2 milestone Apr 13, 2015
@Marsup Marsup closed this as completed in a4fee36 Apr 13, 2015
@Marsup
Copy link
Collaborator

Marsup commented Apr 13, 2015

Thanks for the report, it's published.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants