[miio] avoid NPE in discovery in case of unexpected response cloud (#11420)

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel 2021-10-22 08:49:45 +02:00 committed by GitHub
parent b893b07329
commit 3eb5e566df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View 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;
}
}