Fixes possible crash in market averages
This commit is contained in:
parent
3fb1b212b6
commit
5ed78da30b
|
@ -42,6 +42,7 @@ namespace TestNetRewarder
|
||||||
private ChainState[] SelectStates(int numberOfIntervals)
|
private ChainState[] SelectStates(int numberOfIntervals)
|
||||||
{
|
{
|
||||||
if (numberOfIntervals < 1) return Array.Empty<ChainState>();
|
if (numberOfIntervals < 1) return Array.Empty<ChainState>();
|
||||||
|
if (numberOfIntervals > buffer.Count) return Array.Empty<ChainState>();
|
||||||
return buffer.TakeLast(numberOfIntervals).ToArray();
|
return buffer.TakeLast(numberOfIntervals).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue