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

Issue with ServerRequest's queryParams [SPR-15740] #20296

Closed
spring-projects-issues opened this issue Jul 6, 2017 · 1 comment
Closed

Issue with ServerRequest's queryParams [SPR-15740] #20296

spring-projects-issues opened this issue Jul 6, 2017 · 1 comment
Assignees
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 6, 2017

Marianne Abdelmalek opened SPR-15740 and commented

Although the documentation states that:

/**
	 * Return the first query parameter with the given name, if present.
	 * @param name the parameter name
	 * @return the parameter value
	 */
	default Optional<String> queryParam(String name) {
		List<String> queryParams = this.queryParams(name);
		return (!queryParams.isEmpty() ? Optional.of(queryParams.get(0)) : Optional.empty());
	}

which returns Optional, it throws null pointer exception when the query param is not present.
The line that throws the null pointer exception is:

//req is of type ServerRequest
req.queryParam("page")

It used to work properly days ago, I guess you guys changed something. Please check.


Referenced from: commits 0065bc5

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 6, 2017

Arjen Poutsma commented

Sorry, I broke this method earlier this week, but it is now fixed in master. Thanks for reporting this!

See 0065bc5

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

Successfully merging a pull request may close this issue.

None yet
2 participants