From 8b4db67ae91b91dd7465f69c8b1955d6999f04ef Mon Sep 17 00:00:00 2001 From: Nils Nemitz Date: Sun, 18 Jul 2021 17:24:55 +0900 Subject: [PATCH] None-check self.label before access --- pyqtgraph/graphicsItems/AxisItem.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyqtgraph/graphicsItems/AxisItem.py b/pyqtgraph/graphicsItems/AxisItem.py index 97baebc4..cf98d6ec 100644 --- a/pyqtgraph/graphicsItems/AxisItem.py +++ b/pyqtgraph/graphicsItems/AxisItem.py @@ -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':