Ingenico-ePayments / connect-sdk-java

Ingenico Connect Java Server SDK
https://docs.connect.worldline-solutions.com/documentation/sdk/server/java/
Other
31 stars 23 forks source link

NullPointerException #5

Closed ntls closed 6 years ago

ntls commented 6 years ago

Gives NPE when entry.getValue() = null;

https://github.com/Ingenico-ePayments/connect-sdk-java/blob/ac97be3688be32001d9dbd21c7788e6389a6d761/src/main/java/com/ingenico/connect/gateway/sdk/java/ApiResource.java#L72

rob-spoor commented 6 years ago

Can you show us some code you used to trigger this? If it is caused by a null argument to a resource method, then this is a programmer error. Any fix (if one is made) would only cause the NPE to be thrown earlier (or perhaps as an IllegalArgumentException).

ntls commented 6 years ago

client.merchant(merchantId).payments().refund(refundId, refundRequest);

And I pass as refundId=null. If I put anything than null, it works as I supposed to.

rob-spoor commented 6 years ago

Like I said, this is a programmer error. Passing a null for the refund id will always cause an error.

On a side note, I'd like to note that this call requires a payment id, not a refund id. A refund is always performed in the context of a payment.

ntls commented 6 years ago

Ok, thanks.