]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] avoid NPE in discovery in case of unexpected response cloud (#11420)
authorMarcel <marcel@verpaalen.com>
Fri, 22 Oct 2021 06:49:45 +0000 (08:49 +0200)
committerGitHub <noreply@github.com>
Fri, 22 Oct 2021 06:49:45 +0000 (08:49 +0200)
Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/cloud/CloudDeviceListDTO.java

index b00a979503c315a603c7ba7e164c16f7499e04da..3f823b66958c689aaf3c479365d6806a74864fec 100644 (file)
@@ -12,6 +12,7 @@
  */
 package org.openhab.binding.miio.internal.cloud;
 
+import java.util.Collections;
 import java.util.List;
 
 import com.google.gson.annotations.Expose;
@@ -29,6 +30,9 @@ public class CloudDeviceListDTO {
     private List<CloudDeviceDTO> cloudDevices = null;
 
     public List<CloudDeviceDTO> getCloudDevices() {
+        if (cloudDevices == null) {
+            return Collections.emptyList();
+        }
         return cloudDevices;
     }
 }