don't assume 'type' to be present at all times

closes #9629
This commit is contained in:
Matthias
2024-01-02 09:23:02 +01:00
parent e722d81456
commit 2c3cef5dee

View File

@@ -228,7 +228,7 @@ class Okx(Exchange):
f'StoplossOrder not found (pair: {pair} id: {order_id}).')
def get_order_id_conditional(self, order: Dict[str, Any]) -> str:
if order['type'] == 'stop':
if order.get('type', '') == 'stop':
return safe_value_fallback2(order, order, 'id_stop', 'id')
return order['id']