]> git.basschouten.com Git - openhab-addons.git/commitdiff
[tellstick] Fix for NPE (#10377) (#10378)
authorJan Gustafsson <jannegpriv@gmail.com>
Tue, 23 Mar 2021 07:39:17 +0000 (08:39 +0100)
committerGitHub <noreply@github.com>
Tue, 23 Mar 2021 07:39:17 +0000 (08:39 +0100)
Signed-off-by: Jan Gustafsson <jannegpriv@gmail.com>
bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveBridgeHandler.java
bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/TelldusLocalBridgeHandler.java

index c5ac655d0436b9e785959ac6da2b70994e2b437d..35824457eee37c9acb50c9735229d958695bf4ed 100644 (file)
@@ -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");
         }
     }
 
index d1a7dd4a09b1f02ce5a9eda53cfe3766f9c29df8..be050ba42c61da7d4971c29c19f40264fa32b60e 100644 (file)
@@ -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");
         }
     }