Skip to content

Commit b40b657

Browse files
committed
Fix instrument.id null dereferences in error logs
1 parent 43b5879 commit b40b657

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

RELEASES.md

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ This release will be the final version that uses Poetry for package and dependen
4343
- Fixed typo in `delta.rs` doc comment (#2230), thanks @eltociear
4444
- Fixed memory leak in network PyO3 layer caused by the `gil-refs` feature (#2229), thanks for reporting @davidsblom
4545
- Fixed reconnect handling for Betfair (#2232), thanks @limx0
46+
- Fixed `instrument.id` null dereferences in error logs (#2237), thanks for reporting @ryantam626
47+
- Fixed schema for listing markets of dYdX (#2240), thanks @davidsblom
4648

4749
### Documentation Updates
4850
- Added Databento overview (#2233), thanks @stefansimik

nautilus_trader/portfolio/portfolio.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ cdef class Portfolio(PortfolioFacade):
183183
if instrument is None:
184184
self._log.error(
185185
f"Cannot update initial (order) margin: "
186-
f"no instrument found for {instrument.id}"
186+
f"no instrument found for {instrument_id}"
187187
)
188188
initialized = False
189189
break
@@ -274,7 +274,7 @@ cdef class Portfolio(PortfolioFacade):
274274
if instrument is None:
275275
self._log.error(
276276
f"Cannot update maintenance (position) margin: "
277-
f"no instrument found for {instrument.id}"
277+
f"no instrument found for {instrument_id}"
278278
)
279279
initialized = False
280280
break

nautilus_trader/risk/engine.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ cdef class RiskEngine(Component):
427427
if instrument is None:
428428
self._deny_command(
429429
command=command,
430-
reason=f"Instrument for {command.instrument_id} not found",
430+
reason=f"Instrument for {order.instrument_id} not found",
431431
)
432432
return # Denied
433433

0 commit comments

Comments
 (0)