]> git.basschouten.com Git - openhab-addons.git/commitdiff
[ecobee] fix NullPointerException in EcobeeAccountBridgeHandler.refreshThermostats...
authorrobnielsen <rob.nielsen@yahoo.com>
Thu, 22 Feb 2024 07:45:55 +0000 (01:45 -0600)
committerGitHub <noreply@github.com>
Thu, 22 Feb 2024 07:45:55 +0000 (08:45 +0100)
Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>
bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/handler/EcobeeAccountBridgeHandler.java

index b055b64982ac9a41d0a3beaaf0825a5c4340a479..67c7c84a92dbbc1b006ab59190c3cd87b8ddabe2 100644 (file)
@@ -220,10 +220,13 @@ public class EcobeeAccountBridgeHandler extends BaseBridgeHandler {
             refreshThermostatsCounter.set(refreshIntervalNormal);
             SummaryResponseDTO summary = api.performThermostatSummaryQuery();
             if (summary != null && summary.hasChanged(previousSummary) && !thermostatIds.isEmpty()) {
-                for (ThermostatDTO thermostat : api.performThermostatQuery(thermostatIds)) {
-                    EcobeeThermostatBridgeHandler handler = thermostatHandlers.get(thermostat.identifier);
-                    if (handler != null) {
-                        handler.updateChannels(thermostat);
+                List<ThermostatDTO> thermostats = api.performThermostatQuery(thermostatIds);
+                if (thermostats != null) {
+                    for (ThermostatDTO thermostat : thermostats) {
+                        EcobeeThermostatBridgeHandler handler = thermostatHandlers.get(thermostat.identifier);
+                        if (handler != null) {
+                            handler.updateChannels(thermostat);
+                        }
                     }
                 }
             }