From f0eafacfa33a1d33a97364381c97223975df190b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 23 Aug 2024 17:17:35 -0400 Subject: [PATCH] Update src/app/clusters/thermostat-server/thermostat-server-presets.cpp --- .../clusters/thermostat-server/thermostat-server-presets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/thermostat-server/thermostat-server-presets.cpp b/src/app/clusters/thermostat-server/thermostat-server-presets.cpp index 83d5f710defd66..a56c94fa49834d 100644 --- a/src/app/clusters/thermostat-server/thermostat-server-presets.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server-presets.cpp @@ -408,7 +408,7 @@ CHIP_ERROR ThermostatAttrAccess::AppendPendingPreset(Thermostat::Delegate * dele uint8_t numberOfPendingPresets = CountNumberOfPendingPresets(delegate); // We will be adding one more preset, so reject if the length is already at max. - if (numberOfPendingPresets >= numberOfPresetsSupported) + if (numberOfPendingPresets >= delegate->GetNumberOfPresets()) { return CHIP_IM_GLOBAL_STATUS(ResourceExhausted); }