Check if order is a dict before parsing

closes #4331
This commit is contained in:
Matthias
2021-02-08 19:35:22 +01:00
parent de727645ab
commit c5ab3a80a5
2 changed files with 13 additions and 1 deletions

View File

@@ -171,6 +171,10 @@ class Order(_DECL_BASE):
"""
Get all non-closed orders - useful when trying to batch-update orders
"""
if not isinstance(order, dict):
logger.warning(f"{order} is not a valid response object.")
return
filtered_orders = [o for o in orders if o.order_id == order.get('id')]
if filtered_orders:
oobj = filtered_orders[0]