dotnet-state-machine / stateless

A simple library for creating state machines in C# code
Other
5.6k stars 766 forks source link

StateMachineInfo.InitialState.Transitions throws if AddRelationships not called #514

Closed leeoades closed 1 year ago

leeoades commented 1 year ago

For StateInfo, Substates, FixedTransitions and DynamicTransitions are only initialised by a call to AddRelationships.

However, for StateMachineInfo.InitialState, this never happens.

Therefore StateMachineInfo.InitialState.Transitions throws a System.ArgumentNullException.

The StateInfo object should not throw if "half initialised"

mclift commented 1 year ago

Thanks for your contribution, @leeoades!

leeoades commented 1 year ago

I take it only a maintainer can merge the PR? @mclift