Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mkurz
Copy link
Member

@mkurz mkurz commented Apr 27, 2016

Just a small fix.
We have a test where we create a DynamicForm or Field without any injected components (no MessagesApi, Validator, etc.)
When we want to access a field on this dummy DynamicForm we get a NullPointerException because no validator is set.
E.g. this line throws the NPE:

new DynamicForm(null, null, null).field("somefield");

Please backport before the 2.5.3 release, thanks!

@marcospereira
Copy link
Member

@mkurz, could you please add some tests here?

@mkurz mkurz force-pushed the validatorNPEfix branch 2 times, most recently from 781f57c to f9c5fd0 Compare April 27, 2016 17:58
@mkurz mkurz force-pushed the validatorNPEfix branch from f9c5fd0 to b2df41d Compare April 27, 2016 21:15
@mkurz mkurz changed the title Don't throw NPE when validator is null Don't throw NPE when variables in a Form or a Field are null Apr 27, 2016
@mkurz
Copy link
Member Author

mkurz commented Apr 27, 2016

Updated the PR and added tests.
If this could be backported before the 2.5.3 release this would be nice.
It would help us to create dummy forms and fields.
Thanks!

@gmethvin gmethvin merged commit 30c9dbd into playframework:master Apr 27, 2016
@gmethvin
Copy link
Member

2.5.x: b27b47e

@gmethvin gmethvin added this to the 2.5.3 milestone Apr 27, 2016
@mkurz mkurz deleted the validatorNPEfix branch April 28, 2016 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants