mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2026-02-16 14:13:46 +00:00
Fixed exception when initial trade snapshot has no items in TradeTracker
This commit is contained in:
parent
99bf6d7c75
commit
04e4ddf525
@ -325,9 +325,12 @@ namespace CryptoExchange.Net.Trackers.Trades
|
||||
if (Period != null)
|
||||
items = items.Where(e => e.Timestamp >= DateTime.UtcNow.Add(-Period.Value));
|
||||
|
||||
_snapshotId = data.Max(d => d.Timestamp.Ticks);
|
||||
foreach (var item in items.OrderBy(d => d.Timestamp))
|
||||
_data.Add(item);
|
||||
if (items.Any())
|
||||
{
|
||||
_snapshotId = data.Max(d => d.Timestamp.Ticks);
|
||||
foreach (var item in items.OrderBy(d => d.Timestamp))
|
||||
_data.Add(item);
|
||||
}
|
||||
|
||||
_snapshotSet = true;
|
||||
_changed = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user