fix(ftx): klines should not be empty

This commit is contained in:
Jui-Nan Lin 2021-05-31 22:56:26 +08:00
parent 7ff4051c61
commit 7abd7225e1

View File

@ -139,7 +139,7 @@ func (s *Stream) pollKLines(ctx context.Context) {
for _, sub := range s.klineSubscriptions {
klines := getLastKLine(s.exchange, ctx, sub.symbol, sub.interval)
if len(klines) >= 0 {
if len(klines) > 0 {
// handle mutiple klines, get the latest one
s.EmitKLineClosed(klines[len(klines)-1])
}