Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

HttpClientProtocol bug fix

Rich Turnerd863909bfa05
diff --git a/agent/src/main/java/org/openremote/agent/protocol/http/HttpClientProtocol.java b/agent/src/main/java/org/openremote/agent/protocol/http/HttpClientProtocol.java
index 22247f9d8..969e3cabf 100644
--- a/agent/src/main/java/org/openremote/agent/protocol/http/HttpClientProtocol.java
+++ b/agent/src/main/java/org/openremote/agent/protocol/http/HttpClientProtocol.java
@@ -909,7 +909,8 @@ public class HttpClientProtocol extends AbstractProtocol {
if (response != null && response.getStatusInfo().getFamily() == Response.Status.Family.SUCCESSFUL) {
try {
- value = response.getEntity() != null ? Values.create(response.readEntity(String.class)) : null;
+ String responseBody = response.readEntity(String.class);
+ value = responseBody != null ? Values.create(responseBody) : null;
} catch (Exception e) {
LOG.log(Level.SEVERE, "Error occurred whilst trying to read response body", e);
if (request.updateConnectionStatus) {