Skip to content

Deleting an entity throws NullPointerException #52

@tiainen

Description

@tiainen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions