diff --git a/bec_widgets/widgets/plots/image/image_base.py b/bec_widgets/widgets/plots/image/image_base.py index ca2ef731..1b638906 100644 --- a/bec_widgets/widgets/plots/image/image_base.py +++ b/bec_widgets/widgets/plots/image/image_base.py @@ -1034,7 +1034,8 @@ class ImageBase(PlotBase): if self.y_roi is not None: self.y_roi.cleanup_pyqtgraph() - self.layer_manager.clear() - self.layer_manager = None + if self.layer_manager is not None: + self.layer_manager.clear() + self.layer_manager = None super().cleanup()