From df2a04fc4e8f7b5cba31b53a6364a83a69e418c1 Mon Sep 17 00:00:00 2001 From: Edanflame <237397488@qq.com> Date: Wed, 17 Nov 2021 16:29:38 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=20=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy_tushare/tushare_datafeed.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vnpy_tushare/tushare_datafeed.py b/vnpy_tushare/tushare_datafeed.py index 1e413ba..21e029c 100644 --- a/vnpy_tushare/tushare_datafeed.py +++ b/vnpy_tushare/tushare_datafeed.py @@ -143,7 +143,12 @@ def query_bar_history(self, req: HistoryRequest) -> Optional[List[BarData]]: end = req.end.strftime("%Y%m%d") ts_symbol = to_ts_symbol(symbol, exchange) + if not ts_symbol: + return None + asset = to_ts_asset(symbol, exchange) + if not asset: + return None ts_interval = INTERVAL_VT2TS.get(interval) if not ts_interval: