Add (more) order mode race guards to avoid crashes on "kitty-keys"

history_view
Tyler Goodlet 2022-09-12 15:39:40 -04:00
parent 70f2241d22
commit 20663dfa1c
1 changed files with 8 additions and 1 deletions

View File

@ -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(