fix(ftx): array length should > 0

This commit is contained in:
Jui-Nan Lin 2021-09-03 15:36:50 +08:00
parent 1bc36b17ff
commit feca628319

View File

@ -166,7 +166,7 @@ func (s *Stream) pollKLines(ctx context.Context) {
}
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])
}