mirror of
https://github.com/wassname/libcryptomarket.git
synced 2026-08-25 11:20:04 +08:00
prevent error at this level when no data returned
This commit is contained in:
@@ -87,7 +87,7 @@ def get_historical_prices(source='cryptocompare', symbol=None, exchange=None,
|
||||
|
||||
data = pd.DataFrame([CryptocompareHisto(**e).__dict__ for e in data])
|
||||
# Filter only valid time range
|
||||
if from_time is not None and to_time is not None:
|
||||
if len(data) and from_time is not None and to_time is not None:
|
||||
data = data[(data['r_time'] >= from_time) &
|
||||
(data['r_time'] <= to_time)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user