Skip to content

Commit f2244fb

Browse files
committed
fix profile error when plot item is None
1 parent 5794746 commit f2244fb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/silx/gui/plot/tools/profile

src/silx/gui/plot/tools/profile/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ def _setPlotItem(self, plotItem):
126126
previousPlotItem = self.getPlotItem()
127127
if previousPlotItem is plotItem:
128128
return
129-
self.__plotItem = weakref.ref(plotItem)
129+
if plotItem is None:
130+
self.__plotItem = None
131+
else:
132+
self.__plotItem = weakref.ref(plotItem)
130133
self.sigPlotItemChanged.emit()
131134

132135
def getPlotItem(self):

0 commit comments

Comments
 (0)