Skip to content
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

Fix bug with NPE #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix bug with NPE #1

wants to merge 1 commit into from

Conversation

gtors
Copy link

@gtors gtors commented Aug 16, 2017

NullPointerException is raised If at least one item in constrained collection is null.

@Validateable
class SomeCommand {
    List<SubCommand> items
    static constraints = {
         items cascade: true
    }
}

new SomeCommand(items: [null]).validate() // NPE thrown, because `null`  does not have a `class` field

If item in validateable collection is `null`, then `NullPointerException` is raised:

```groovy
@Validateable
class SomeCommand {
    List<SubCommand> items
    static constraints = {
         items cascade: true
    }
}

new SomeCommand(items: [null]).validate()
```
@rmorrise
Copy link

I have published 0.1.5 version of the plugin for Grails 2. Sorry for the delay. Can you please verify it?

Thanks!

@gtors
Copy link
Author

gtors commented Aug 16, 2017

Sure. I have successfully updated plugin up to 0.1.5 version and checking for null is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants