-
Notifications
You must be signed in to change notification settings - Fork 2.3k
ClientResponse.hasEntity() should not throw a NullPointerException #2113
Comments
Reported by codingfabian |
Issue-Links: |
mfuksa said: can you please provide more details? I cannot reproduce the NPE. I tried with 500 and 204 responses and never get NPE in ClientResponse.hasEntity(). I have tested it against 1.17 and with latest snapshot version. Exception stack trace and code example would help. The best would be simple maven project with test simulating the bug. Thanks. I have the same problem with #1944 should not throw a NullPointerException") as I cannot reproduce it. |
mfuksa said: |
pabstec said: java.lang.NullPointerException |
pabstec said:
|
This issue was imported from java.net JIRA JERSEY-1841 |
Similar to #1944 should not throw a NullPointerException"), the hasEntity method throws a null pointer exception when entity is null (like for a 500 response).
When you have filters which look at possible JSON entities, it would be great to not get a null pointer.
The workaround is to check for getEntityInputStream() != null first, which is kind of awkward.
Affected Versions
[1.17]
The text was updated successfully, but these errors were encountered: