From 3ca9b56380967265a064c5b9cc6757bbb01eac51 Mon Sep 17 00:00:00 2001 From: d00616 Date: Sun, 1 Oct 2017 09:41:36 +0200 Subject: [PATCH] Fix uninitialized state handling (#939) --- core/MyTransport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/MyTransport.cpp b/core/MyTransport.cpp index 68eb10a..052aa7f 100644 --- a/core/MyTransport.cpp +++ b/core/MyTransport.cpp @@ -367,7 +367,7 @@ void transportSwitchSM(transportState_t& newState) } else { _transportSM.stateRetries++; // increment retries } - if (_transportSM.currentState->Transition) { + if (_transportSM.currentState) { _transportSM.currentState->Transition(); // State transition } _transportSM.stateEnter = hwMillis(); // save time @@ -380,7 +380,7 @@ uint32_t transportTimeInState(void) void transportUpdateSM(void) { - if (_transportSM.currentState->Update) { + if (_transportSM.currentState) { _transportSM.currentState->Update(); } }