Fixed NPE during dispose in Response if entity is null
This commit is contained in:
parent
879a063b57
commit
bde58d6add
|
@ -70,9 +70,11 @@ public class Response {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
final HttpEntity entity = this.response.getEntity();
|
final HttpEntity entity = this.response.getEntity();
|
||||||
final InputStream content = entity.getContent();
|
if (entity != null) {
|
||||||
if (content != null) {
|
final InputStream content = entity.getContent();
|
||||||
content.close();
|
if (content != null) {
|
||||||
|
content.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (final Exception ignore) {
|
} catch (final Exception ignore) {
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -133,7 +135,6 @@ public class Response {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.consumed = true;
|
this.consumed = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue