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

NPE in tests when passing query string without parameter value in tests #1167

Closed
alniks opened this issue Nov 19, 2021 · 1 comment
Closed

Comments

@alniks
Copy link

alniks commented Nov 19, 2021

the following will result in NullPointerException:

 controller("/view")
                .queryString("p1")
                .get("index");

java.lang.NullPointerException: Cannot invoke "Object.toString()" because "v" is null at org.javalite.activeweb.RequestBuilder.addParameterValues(RequestBuilder.java:431) at org.javalite.activeweb.RequestBuilder.addParameterValuesFromQueryString(RequestBuilder.java:442) at org.javalite.activeweb.RequestBuilder.createAndConfigureRequest(RequestBuilder.java:407) at org.javalite.activeweb.RequestBuilder.submitRequest(RequestBuilder.java:332) at org.javalite.activeweb.RequestBuilder.get(RequestBuilder.java:285) at app.controllers.filters.FilterSpec.shouldView(FilterSpec.java:85)

replacing .queryString("p1") with .queryString("p1=1") removes the error

@alniks alniks changed the title NPE in tests when passing query string without parameter values NPE in tests when passing query string without parameter values in tests Nov 19, 2021
@alniks alniks changed the title NPE in tests when passing query string without parameter values in tests NPE in tests when passing query string without parameter value in tests Nov 19, 2021
@ipolevoy ipolevoy self-assigned this Nov 20, 2021
@ipolevoy
Copy link
Member

@alniks this is fixed, thanks for reporting

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

No branches or pull requests

2 participants