diff --git a/tinkoff/invest/caching/market_data_cache/cache.py b/tinkoff/invest/caching/market_data_cache/cache.py index a04e397..2bf454d 100644 --- a/tinkoff/invest/caching/market_data_cache/cache.py +++ b/tinkoff/invest/caching/market_data_cache/cache.py @@ -59,8 +59,8 @@ def _with_saving_into_cache( from_net: Iterable[HistoricCandle], ) -> Iterable[HistoricCandle]: candles = list(from_net) - if candles: - complete_candles = list(self._filter_complete_candles(candles)) + complete_candles = list(self._filter_complete_candles(candles)) + if complete_candles: complete_candle_times = [candle.time for candle in complete_candles] complete_net_range = ( min(complete_candle_times),