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

Deleting an entity throws NullPointerException #52

Open
tiainen opened this issue Jun 11, 2018 · 0 comments
Open

Deleting an entity throws NullPointerException #52

tiainen opened this issue Jun 11, 2018 · 0 comments

Comments

@tiainen
Copy link

tiainen commented Jun 11, 2018

When I delete an entity, for example a customer mandate, handling the response throws a NullPointerException.

java.lang.NullPointerException
	at nl.stil4m.mollie.RequestExecutor.deserialize(RequestExecutor.java:43)
	at nl.stil4m.mollie.RequestExecutor.lambda$execute$0(RequestExecutor.java:34)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139)
	at nl.stil4m.mollie.RequestExecutor.execute(RequestExecutor.java:30)
	at nl.stil4m.mollie.concepts.AbstractConcept.requestVoid(AbstractConcept.java:70)
	at nl.stil4m.mollie.concepts.Delete.delete(Delete.java:12)
	....

The reason is that the RequestExecutor tries to deserialise the response entity of a response with status 204 No Content. The following line fails because response.getEntity() is null:
https://github.com/stil4m/mollie-api/blob/2.7.0/src/main/java/nl/stil4m/mollie/RequestExecutor.java#L43

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

No branches or pull requests

1 participant