Bug 741165 - Correct SyncResponse.jsonBody. r=msamuel

This commit is contained in:
Richard Newman 2012-04-03 16:43:06 -07:00
parent 330a3cd6f9
commit bf5abf9b00

View File

@ -71,14 +71,19 @@ public class SyncResponse {
ParseException { ParseException {
if (body != null) { if (body != null) {
// Do it from the cached String. // Do it from the cached String.
ExtendedJSONObject.parse(body); return ExtendedJSONObject.parse(body);
} }
HttpEntity entity = this.response.getEntity(); HttpEntity entity = this.response.getEntity();
if (entity == null) { if (entity == null) {
return null; return null;
} }
InputStream content = entity.getContent(); InputStream content = entity.getContent();
return ExtendedJSONObject.parse(content); try {
return ExtendedJSONObject.parse(content);
} finally {
content.close();
}
} }
/** /**