From 917d1d0e1c8569c0a8a8698fb9936025674ff4bb Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Fri, 24 Mar 2023 13:26:46 -0400 Subject: [PATCH] [Silabs] Add nullable value check (#25820) --- examples/thermostat/silabs/efr32/src/TemperatureManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/thermostat/silabs/efr32/src/TemperatureManager.cpp b/examples/thermostat/silabs/efr32/src/TemperatureManager.cpp index 30b2ab26b91da8..7bff7a7907cb96 100644 --- a/examples/thermostat/silabs/efr32/src/TemperatureManager.cpp +++ b/examples/thermostat/silabs/efr32/src/TemperatureManager.cpp @@ -56,7 +56,7 @@ CHIP_ERROR TemperatureManager::Init() ThermAttr::SystemMode::Get(kThermostatEndpoint, &systemMode); PlatformMgr().UnlockChipStack(); - mCurrentTempCelsius = ConvertToPrintableTemp(temp.Value()); + mCurrentTempCelsius = ConvertToPrintableTemp((temp.IsNull()) ? static_cast(0.0) : temp.Value()); mHeatingCelsiusSetPoint = ConvertToPrintableTemp(coolingSetpoint); mCoolingCelsiusSetPoint = ConvertToPrintableTemp(heatingSetpoint); mThermMode = systemMode;