None-check self.label before access

This commit is contained in:
Nils Nemitz 2021-07-18 17:24:55 +09:00
parent ed66eef203
commit 8b4db67ae9

View File

@ -233,6 +233,10 @@ class AxisItem(GraphicsWidget):
## Set the position of the label
nudge = 5
if self.label is None: # self.label is set to None on close, but resize events can still occur.
self.picture = None
return
br = self.label.boundingRect()
p = QtCore.QPointF(0, 0)
if self.orientation == 'left':