Merge pull request #1909 from NilsNemitz/None-check_AxisItem_label

None-check AxisItem.label before access
This commit is contained in:
Ogi Moore 2021-07-18 10:44:48 -07:00 committed by GitHub
commit 4e293dd17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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':