Fixes possible crash in market averages

This commit is contained in:
benbierens 2024-04-11 17:28:12 +02:00
parent 3fb1b212b6
commit 5ed78da30b
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
1 changed files with 1 additions and 0 deletions

View File

@ -42,6 +42,7 @@ namespace TestNetRewarder
private ChainState[] SelectStates(int numberOfIntervals)
{
if (numberOfIntervals < 1) return Array.Empty<ChainState>();
if (numberOfIntervals > buffer.Count) return Array.Empty<ChainState>();
return buffer.TakeLast(numberOfIntervals).ToArray();
}