Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander van Delft committed May 22, 2024
1 parent a03d153 commit 6982bf5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions CometServer/Services/BusinessLogic/OldParameterContextProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,17 @@ public ParameterValueSet GetsourceValueSet(Guid? option, Guid? state)
: this.OldValueSet.FirstOrDefault(x => x.ActualOption == option.Value);
}

// old is only state dependent
return this.OldDefaultState != null ? this.OldValueSet.FirstOrDefault(x => x.ActualState == this.OldDefaultState.Iid) : this.OldValueSet.FirstOrDefault();
if (!this.IsOldOptionDependent)
{
// old is only state dependent
return this.OldDefaultState != null ? this.OldValueSet.FirstOrDefault(x => x.ActualState == this.OldDefaultState.Iid) : this.OldValueSet.FirstOrDefault();
}

if (!this.IsOldStateDependent)
{
// old is only option dependent
return this.OldDefaultOption != null ? this.OldValueSet.FirstOrDefault(x => x.ActualOption == option.Value) : this.OldValueSet.FirstOrDefault();
}
}

// new is only state dependent
Expand Down

0 comments on commit 6982bf5

Please sign in to comment.