Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

NullPointerException When Trying to Send Null Payload #14

Closed
PaulSzyller opened this issue Dec 5, 2018 · 0 comments · Fixed by #28
Closed

NullPointerException When Trying to Send Null Payload #14

PaulSzyller opened this issue Dec 5, 2018 · 0 comments · Fixed by #28

Comments

@PaulSzyller
Copy link

How to reproduce:

HttpRequest request = new HttpRequest()
// set request fields

httpClient.post(request, null)

Stacktrace:

java.lang.NullPointerException: null
	at com.budjb.httprequests.converter.EntityConverterManager.write(EntityConverterManager.java:137)
	at com.budjb.httprequests.AbstractHttpClient.execute(AbstractHttpClient.java:104)
	at com.budjb.httprequests.AbstractHttpClient.post(AbstractHttpClient.java:216)
	at com.budjb.httprequests.HttpClient$post.call(Unknown Source)

Whether it is good practice to call httpClient.post() with a null payload is debatable, but I don't believe it should throw a NullPointerException.

@budjb budjb closed this as completed in #28 May 21, 2020
budjb added a commit that referenced this issue May 21, 2020
* Fix NullPointerException when sending a null entity (#14).

* Prevent getting a response entity that does not exist from throwing an exception (#13).

* Throw a URISyntaxException instead of a NullPointerException when a URI is not absolute (#12)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant