From 5477fa5fb18ab6697cdb20d66df62ff3f25f3e5d Mon Sep 17 00:00:00 2001 From: Jan Gustafsson Date: Tue, 23 Mar 2021 08:39:17 +0100 Subject: [PATCH] [tellstick] Fix for NPE (#10377) (#10378) Signed-off-by: Jan Gustafsson --- .../tellstick/internal/live/TelldusLiveBridgeHandler.java | 4 +++- .../tellstick/internal/local/TelldusLocalBridgeHandler.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveBridgeHandler.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveBridgeHandler.java index c5ac655d04..35824457ee 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveBridgeHandler.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveBridgeHandler.java @@ -128,8 +128,8 @@ public class TelldusLiveBridgeHandler extends BaseBridgeHandler implements Telld 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()) { @@ -172,6 +172,8 @@ public class TelldusLiveBridgeHandler extends BaseBridgeHandler implements Telld device.setUpdated(false); } } + } else { + logger.debug("updateDevices, rest API returned null"); } } diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/TelldusLocalBridgeHandler.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/TelldusLocalBridgeHandler.java index d1a7dd4a09..be050ba42c 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/TelldusLocalBridgeHandler.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/TelldusLocalBridgeHandler.java @@ -111,8 +111,8 @@ public class TelldusLocalBridgeHandler extends BaseBridgeHandler implements Tell 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); @@ -158,6 +158,8 @@ public class TelldusLocalBridgeHandler extends BaseBridgeHandler implements Tell device.setUpdated(false); } } + } else { + logger.debug("updateDevices, rest API returned null"); } } -- 2.47.3