Skip to content

Commit

Permalink
* Fix nil pointer error caused by tick data is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
edward-frankieone committed Aug 18, 2024
1 parent dfd0542 commit f1f0614
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/tickdata/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func (s Stream) EachTick(it Iterator) {
}

bi.EachTick(func(tick *tickdata.TickData, err error) bool {
if tick == nil {
return true
}
tickTime := tick.TimeInLocation(loc)
if (start.Equal(tickTime) || start.Before(tickTime)) &&
(end.Equal(tickTime) || end.After(tickTime)) {
Expand Down

0 comments on commit f1f0614

Please sign in to comment.