mirror of https://github.com/apache/jclouds.git
check null before attempting to close a stream
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1440 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
b858ec002e
commit
ec11f2ef20
|
@ -40,9 +40,9 @@ public class CloseContentAndSetExceptionHandler implements HttpResponseHandler {
|
||||||
public void handle(HttpFutureCommand<?> command, HttpResponse response) {
|
public void handle(HttpFutureCommand<?> command, HttpResponse response) {
|
||||||
String content;
|
String content;
|
||||||
try {
|
try {
|
||||||
content = Utils.toStringAndClose(response.getContent());
|
content = response.getContent() != null ? Utils.toStringAndClose(response.getContent())
|
||||||
command.setException(new HttpResponseException(command, response,
|
: null;
|
||||||
content));
|
command.setException(new HttpResponseException(command, response, content));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
command.setException(new HttpResponseException(command, response));
|
command.setException(new HttpResponseException(command, response));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue