Avoid null index race-error during startup

py3.10_support
Tyler Goodlet 2022-02-07 08:47:03 -05:00
parent 999d3efdd7
commit 1aaa382036
1 changed files with 6 additions and 5 deletions

View File

@ -109,11 +109,12 @@ class LineDot(pg.CurvePoint):
# first = self._plot._arrays['ohlc'][0]['index']
# first = x[0]
# i = index - first
i = index - x[0]
if i > 0 and i < len(y):
newPos = (index, y[i])
QtWidgets.QGraphicsItem.setPos(self, *newPos)
return True
if index:
i = index - x[0]
if i > 0 and i < len(y):
newPos = (index, y[i])
QtWidgets.QGraphicsItem.setPos(self, *newPos)
return True
return False