eclipse-ee4j / eclipse-ee4j/jersey

ClientResponse.hasEntity() should not throw a NullPointerException

Open
#2,113 8 comments 0 reactions 0 assignees View on GitHub
Component: core Priority: Major Type: Bug wontfix
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

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]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.