Don't attempt to convert None to dict

This commit is contained in:
Matthias 2022-12-21 06:28:55 +01:00
parent 70531224e6
commit 73792fd6ce

View File

@ -38,7 +38,7 @@ async def api_start_backtest(bt_settings: BacktestRequest, background_tasks: Bac
btconfig = deepcopy(config)
settings = dict(bt_settings)
if 'freqai' in settings:
if settings.get('freqai', None) is not None:
settings['freqai'] = dict(settings['freqai'])
# Pydantic models will contain all keys, but non-provided ones are None