diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java index 74ea1bc661..0373fbcc73 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java @@ -404,15 +404,11 @@ public abstract class BaseAPI try { - String bodyString = EntityUtils.toString(response.getEntity()); - try - { - responseBody = new JSONObject(bodyString); - } - catch (JSONException error) - { - LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error); - } + responseBody = new JSONObject(EntityUtils.toString(response.getEntity())); + } + catch (JSONException error) + { + LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error); } catch (ParseException | IOException error) {