Merge pull request #269 from jnlin/main

fix FTX API error of empty array
This commit is contained in:
Yo-An Lin 2021-09-04 00:38:53 +08:00 committed by GitHub
commit 4a0b4aae53

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])
}