assume "last" can miss from a ticker response

closes #4573
This commit is contained in:
Matthias 2021-03-20 14:58:51 +01:00
parent 43d7f9ac67
commit e315a6a0da

View File

@ -64,7 +64,7 @@ class PriceFilter(IPairList):
:param ticker: ticker dict as returned from ccxt.load_markets()
:return: True if the pair can stay, false if it should be removed
"""
if ticker['last'] is None or ticker['last'] == 0:
if ticker.get('last', None) is None or ticker.get('last') == 0:
self.log_once(f"Removed {pair} from whitelist, because "
"ticker['last'] is empty (Usually no trade in the last 24h).",
logger.info)