Closed kingtom22 closed 2 months ago
You are correct in that, if an etl::fsm
is constructed, but has not had set_states
and start
called, then a call to receive will try to call process_event
on a nullptr
state.
And is it the intended functionality? Wouldnt be better to have an assert and a big if inside the function checking the pointer? I think it is a low hanging fruit and this would make the library safer.
I've already created a hotfix branch with the same change you describe.
The receive function will raise an etl::fsm_not_started
if is_started()
returns false
and only execute the main function if is_started()
returns true
.
Thank You for the quick reaction.
Fixed 20.38.11
Hi,
I noticed, that there is no check of the
p_state
before calling its function.What is the intended functionality? I did not found specifications of this functionality. Other functions of the
etl::fsm
asserting on the p_state before calling it. for example: