Skip to content

Commit

Permalink
[tellstick] Fix for NPE (openhab#10377)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Gustafsson <jannegpriv@gmail.com>
  • Loading branch information
jannegpriv committed Mar 22, 2021
1 parent c709f52 commit 98d02c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ synchronized void refreshDeviceList() {
private synchronized void updateDevices(TellstickNetDevices previouslist) throws TellstickException {
TellstickNetDevices newList = controller.callRestMethod(TelldusLiveDeviceController.HTTP_TELLDUS_DEVICES,
TellstickNetDevices.class);
logger.debug("Device list {}", newList.getDevices());
if (newList.getDevices() != null) {
logger.debug("Device list {}", newList.getDevices());
if (previouslist == null) {
logger.debug("updateDevices, Creating devices.");
for (TellstickNetDevice device : newList.getDevices()) {
Expand Down Expand Up @@ -172,6 +172,8 @@ private synchronized void updateDevices(TellstickNetDevices previouslist) throws
device.setUpdated(false);
}
}
} else {
logger.debug("updateDevices, rest API returned null");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ private synchronized void updateDevices(TellstickLocalDevicesDTO previouslist)
throws TellstickException, InterruptedException {
TellstickLocalDevicesDTO newList = controller
.callRestMethod(TelldusLocalDeviceController.HTTP_LOCAL_API_DEVICES, TellstickLocalDevicesDTO.class);
logger.debug("Device list {}", newList.getDevices());
if (newList.getDevices() != null) {
logger.debug("Device list {}", newList.getDevices());
if (previouslist == null) {
for (TellstickLocalDeviceDTO device : newList.getDevices()) {
device.setUpdated(true);
Expand Down Expand Up @@ -158,6 +158,8 @@ private synchronized void updateDevices(TellstickLocalDevicesDTO previouslist)
device.setUpdated(false);
}
}
} else {
logger.debug("updateDevices, rest API returned null");
}
}

Expand Down

0 comments on commit 98d02c2

Please sign in to comment.