From 3bcd5a8e837d90da7140635c1e58209877cceb3d Mon Sep 17 00:00:00 2001 From: ycdesu Date: Sat, 27 Mar 2021 09:54:12 +0800 Subject: [PATCH] ftx: null guard in close --- pkg/exchange/ftx/stream.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/exchange/ftx/stream.go b/pkg/exchange/ftx/stream.go index dd4fb8d2d..8da44f6d9 100644 --- a/pkg/exchange/ftx/stream.go +++ b/pkg/exchange/ftx/stream.go @@ -41,5 +41,8 @@ func (s *Stream) Subscribe(channel types.Channel, symbol string, _ types.Subscri } } func (s *Stream) Close() error { - return s.wsService.Close() + if s.wsService != nil { + return s.wsService.Close() + } + return nil }