From: robnielsen Date: Thu, 22 Feb 2024 07:45:55 +0000 (-0600) Subject: [ecobee] fix NullPointerException in EcobeeAccountBridgeHandler.refreshThermostats... X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=18c86b4c58bebe9ffae2e58e9791a6e3226e3c44;p=openhab-addons.git [ecobee] fix NullPointerException in EcobeeAccountBridgeHandler.refreshThermostats() (#16442) Signed-off-by: Rob Nielsen --- diff --git a/bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/handler/EcobeeAccountBridgeHandler.java b/bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/handler/EcobeeAccountBridgeHandler.java index b055b64982..67c7c84a92 100644 --- a/bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/handler/EcobeeAccountBridgeHandler.java +++ b/bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/handler/EcobeeAccountBridgeHandler.java @@ -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 thermostats = api.performThermostatQuery(thermostatIds); + if (thermostats != null) { + for (ThermostatDTO thermostat : thermostats) { + EcobeeThermostatBridgeHandler handler = thermostatHandlers.get(thermostat.identifier); + if (handler != null) { + handler.updateChannels(thermostat); + } } } }