From fcaa97a69432ec3089589113cab8ed2e622e18fa Mon Sep 17 00:00:00 2001 From: Rutherther Date: Fri, 20 Jan 2023 16:18:43 +0100 Subject: [PATCH] fix(core): do not update default state --- Core/NosSmooth.Core/Contracts/DefaultContract.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/NosSmooth.Core/Contracts/DefaultContract.cs b/Core/NosSmooth.Core/Contracts/DefaultContract.cs index 7439152..6dc5031 100644 --- a/Core/NosSmooth.Core/Contracts/DefaultContract.cs +++ b/Core/NosSmooth.Core/Contracts/DefaultContract.cs @@ -128,6 +128,12 @@ public class DefaultContract : IContract { return ContractUpdateResponse.NotInterested; } + + if (CurrentState.CompareTo(_defaultState) == 0) + { // cannot update with default state. OnlyExecute has to be called first and update the state. + return ContractUpdateResponse.NotInterested; + } + if (!_actions.ContainsKey(CurrentState)) { Unregister(); -- 2.48.1