From 18c86b4c58bebe9ffae2e58e9791a6e3226e3c44 Mon Sep 17 00:00:00 2001 From: robnielsen Date: Thu, 22 Feb 2024 01:45:55 -0600 Subject: [PATCH] [ecobee] fix NullPointerException in EcobeeAccountBridgeHandler.refreshThermostats() (#16442) Signed-off-by: Rob Nielsen --- .../internal/handler/EcobeeAccountBridgeHandler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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); + } } } } -- 2.47.3