diff --git a/vn.okcoin/vnokcoin.py b/vn.okcoin/vnokcoin.py index c5ba88bf..7aeac6f6 100644 --- a/vn.okcoin/vnokcoin.py +++ b/vn.okcoin/vnokcoin.py @@ -169,7 +169,7 @@ class OkCoinApi(object): #---------------------------------------------------------------------- def close(self): """关闭接口""" - if self.thread.isAlive: + if self.thread and self.thread.isAlive: self.ws.close() self.thread.join() diff --git a/vn.trader/okcoinGateway/vnokcoin.py b/vn.trader/okcoinGateway/vnokcoin.py index c5ba88bf..7aeac6f6 100644 --- a/vn.trader/okcoinGateway/vnokcoin.py +++ b/vn.trader/okcoinGateway/vnokcoin.py @@ -169,7 +169,7 @@ class OkCoinApi(object): #---------------------------------------------------------------------- def close(self): """关闭接口""" - if self.thread.isAlive: + if self.thread and self.thread.isAlive: self.ws.close() self.thread.join()