Skip to content

Commit 18c86b4

Browse files
authored
[ecobee] fix NullPointerException in EcobeeAccountBridgeHandler.refreshThermostats() (openhab#16442)
Signed-off-by: Rob Nielsen <[email protected]>
1 parent dc1211b commit 18c86b4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/handler/EcobeeAccountBridgeHandler.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,13 @@ private void refreshThermostats() {
220220
refreshThermostatsCounter.set(refreshIntervalNormal);
221221
SummaryResponseDTO summary = api.performThermostatSummaryQuery();
222222
if (summary != null && summary.hasChanged(previousSummary) && !thermostatIds.isEmpty()) {
223-
for (ThermostatDTO thermostat : api.performThermostatQuery(thermostatIds)) {
224-
EcobeeThermostatBridgeHandler handler = thermostatHandlers.get(thermostat.identifier);
225-
if (handler != null) {
226-
handler.updateChannels(thermostat);
223+
List<ThermostatDTO> thermostats = api.performThermostatQuery(thermostatIds);
224+
if (thermostats != null) {
225+
for (ThermostatDTO thermostat : thermostats) {
226+
EcobeeThermostatBridgeHandler handler = thermostatHandlers.get(thermostat.identifier);
227+
if (handler != null) {
228+
handler.updateChannels(thermostat);
229+
}
227230
}
228231
}
229232
}

0 commit comments

Comments
 (0)