Skip to content

Commit

Permalink
(#123) Null check model before id check
Browse files Browse the repository at this point in the history
  • Loading branch information
pardahlman committed Aug 12, 2017
1 parent 57a192e commit 7c22bb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RawRabbit.Operations.StateMachine/StateMachineBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public abstract class StateMachineBase<TState, TTrigger, TModel> : StateMachineB

protected StateMachineBase(TModel model = null)
{
Model = model?.Id == Guid.Empty ? Initialize() : model;
Model = (model == null || model.Id == Guid.Empty) ? Initialize() : model;
StateMachine = new StateMachine<TState, TTrigger>(() => Model.State, s => Model.State = s);
ConfigureState(StateMachine);
}
Expand Down

0 comments on commit 7c22bb1

Please sign in to comment.