Skip to content

Commit ec69e2a

Browse files
committed
Fix bug : Last call to onOperationalStateTimeTick happens after state is already set to Stopped resulting in dereferencing a null pointer. Fix this by returning from function if state is stopped
1 parent 5d4851b commit ec69e2a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/chef/common/chef-rvc-operational-state-delegate.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ static void onOperationalStateTimerTick(System::Layer * systemLayer, void * data
176176
OperationalState::OperationalStateEnum state =
177177
static_cast<OperationalState::OperationalStateEnum>(instance->GetCurrentOperationalState());
178178

179+
if (state == OperationalState::OperationalStateEnum::kStopped) // Do not continue the timer when RVC has stopped.
180+
{
181+
return;
182+
}
183+
179184
if (gRvcOperationalStateDelegate->mCountdownTime.IsNull())
180185
{
181186
if (state == OperationalState::OperationalStateEnum::kRunning)

0 commit comments

Comments
 (0)