Fix uninitialized state handling (#939)

This commit is contained in:
d00616
2017-10-01 09:41:36 +02:00
committed by Olivier
parent 1b1cf8ff9c
commit 3ca9b56380
+2 -2
View File
@@ -367,7 +367,7 @@ void transportSwitchSM(transportState_t& newState)
} else { } else {
_transportSM.stateRetries++; // increment retries _transportSM.stateRetries++; // increment retries
} }
if (_transportSM.currentState->Transition) { if (_transportSM.currentState) {
_transportSM.currentState->Transition(); // State transition _transportSM.currentState->Transition(); // State transition
} }
_transportSM.stateEnter = hwMillis(); // save time _transportSM.stateEnter = hwMillis(); // save time
@@ -380,7 +380,7 @@ uint32_t transportTimeInState(void)
void transportUpdateSM(void) void transportUpdateSM(void)
{ {
if (_transportSM.currentState->Update) { if (_transportSM.currentState) {
_transportSM.currentState->Update(); _transportSM.currentState->Update();
} }
} }