Add (more) order mode race guards to avoid crashes on "kitty-keys"
parent
70f2241d22
commit
20663dfa1c
|
@ -260,8 +260,10 @@ class OrderMode:
|
||||||
'''
|
'''
|
||||||
# not initialized yet
|
# not initialized yet
|
||||||
cursor = self.godw.get_cursor()
|
cursor = self.godw.get_cursor()
|
||||||
chart = cursor.linked.chart
|
if not cursor:
|
||||||
|
return
|
||||||
|
|
||||||
|
chart = cursor.linked.chart
|
||||||
if (
|
if (
|
||||||
not chart
|
not chart
|
||||||
and cursor
|
and cursor
|
||||||
|
@ -271,6 +273,11 @@ class OrderMode:
|
||||||
|
|
||||||
chart = cursor.active_plot
|
chart = cursor.active_plot
|
||||||
price = cursor._datum_xy[1]
|
price = cursor._datum_xy[1]
|
||||||
|
if not price:
|
||||||
|
# zero prices are not supported by any means
|
||||||
|
# since that's illogical / a no-op.
|
||||||
|
return
|
||||||
|
|
||||||
symbol = self.chart.linked.symbol
|
symbol = self.chart.linked.symbol
|
||||||
|
|
||||||
order = self._staged_order = Order(
|
order = self._staged_order = Order(
|
||||||
|
|
Loading…
Reference in New Issue