You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method Runtime.isVoidMethod does not handle the case of target being null and fails with a NPE.
Since most of Geb's own methods return empty strings, empty lists, or empty Navigators this problem does not occur often.
If you take this page, the at check won't fail because helper does not contain "test" or is null. It will cause an NPE.
class PageWithNullInAtChecker extends Page {
static at = { helper()?.contains("test") }
String helper() {
return null
}
}
java.lang.NullPointerException
at geb.transform.implicitassertions.Runtime.isVoidMethod(Runtime.java:18)
at geb.PageWithNullInAtChecker._clinit__closure1(PageOrientedSpec.groovy:533)
at geb.PageWithNullInAtChecker._clinit__closure1(PageOrientedSpec.groovy)
at geb.Page.verifyThisPageAtOnly(Page.groovy:228)
at geb.Page.verifyAt(Page.groovy:182)
at geb.Browser.doAt(Browser.groovy:455)
at geb.Browser.at(Browser.groovy:354)
at geb.Browser.to(Browser.groovy:566)
at geb.Browser.to(Browser.groovy:553)
at geb.Browser.to(Browser.groovy:520)
at geb.test.GebSpec.methodMissing(GebSpec.groovy:91)
at geb.PageOrientedSpec.implicit assertions should handle null(PageOrientedSpec.groovy:401)
The text was updated successfully, but these errors were encountered:
The method
Runtime.isVoidMethod
does not handle the case oftarget
being null and fails with a NPE.Since most of Geb's own methods return empty strings, empty lists, or empty Navigators this problem does not occur often.
If you take this page, the
at
check won't fail because helper does not contain "test" or is null. It will cause an NPE.The text was updated successfully, but these errors were encountered: