mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[miio] Check for null properties (#9408)
Signed-off-by: Mark Hilbush <mark@hilbush.com>
This commit is contained in:
parent
a7009101ba
commit
74bdcb6e85
@ -95,11 +95,16 @@ public class MiIoDiscovery extends AbstractDiscoveryService {
|
||||
if (miioConfig != null) {
|
||||
try {
|
||||
Dictionary<String, @Nullable Object> properties = miioConfig.getProperties();
|
||||
String cloudDiscoveryModeConfig = (String) properties.get("cloudDiscoveryMode");
|
||||
if (cloudDiscoveryModeConfig == null) {
|
||||
String cloudDiscoveryModeConfig;
|
||||
if (properties == null) {
|
||||
cloudDiscoveryModeConfig = DISABLED;
|
||||
} else {
|
||||
cloudDiscoveryModeConfig = cloudDiscoveryModeConfig.toLowerCase();
|
||||
cloudDiscoveryModeConfig = (String) properties.get("cloudDiscoveryMode");
|
||||
if (cloudDiscoveryModeConfig == null) {
|
||||
cloudDiscoveryModeConfig = DISABLED;
|
||||
} else {
|
||||
cloudDiscoveryModeConfig = cloudDiscoveryModeConfig.toLowerCase();
|
||||
}
|
||||
}
|
||||
return Set.of(SUPPORTED, ALL).contains(cloudDiscoveryModeConfig) ? cloudDiscoveryModeConfig : DISABLED;
|
||||
} catch (ClassCastException | SecurityException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user