added notnull check for http commands
This commit is contained in:
parent
db46b7988d
commit
e3ef58c603
@ -119,8 +119,10 @@ public class DeviceСonnectivityServiceImpl implements DeviceConnectivityService
|
|||||||
|
|
||||||
private JsonNode getHttpTransportPublishCommands(String defaultHostname, DeviceCredentials deviceCredentials) {
|
private JsonNode getHttpTransportPublishCommands(String defaultHostname, DeviceCredentials deviceCredentials) {
|
||||||
ObjectNode httpCommands = JacksonUtil.newObjectNode();
|
ObjectNode httpCommands = JacksonUtil.newObjectNode();
|
||||||
httpCommands.put(HTTP, getHttpPublishCommand(HTTP, defaultHostname, deviceCredentials));
|
Optional.ofNullable(getHttpPublishCommand(HTTP, defaultHostname, deviceCredentials))
|
||||||
httpCommands.put(HTTPS, getHttpPublishCommand(HTTPS, defaultHostname, deviceCredentials));
|
.ifPresent(v -> httpCommands.put(HTTP, v));
|
||||||
|
Optional.ofNullable(getHttpPublishCommand(HTTPS, defaultHostname, deviceCredentials))
|
||||||
|
.ifPresent(v -> httpCommands.put(HTTPS, v));
|
||||||
return httpCommands;
|
return httpCommands;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user