Skip to content

Commit

Permalink
Fixed NPE during dispose in Response if entity is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandeep Kulkarni authored and ok2c committed Mar 18, 2021
1 parent 879a063 commit bde58d6
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -70,9 +70,11 @@ private void dispose() {
}
try {
final HttpEntity entity = this.response.getEntity();
final InputStream content = entity.getContent();
if (content != null) {
content.close();
if (entity != null) {
final InputStream content = entity.getContent();
if (content != null) {
content.close();
}
}
} catch (final Exception ignore) {
} finally {
Expand Down Expand Up @@ -133,7 +135,6 @@ public void saveContent(final File file) throws IOException {
}
} finally {
this.consumed = true;

}
}

Expand Down

0 comments on commit bde58d6

Please sign in to comment.