From c1bdc506e8099f178acdccbe0e1109deeeaaca38 Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Fri, 25 Jul 2025 17:58:28 +0200 Subject: [PATCH] fix(image_base): fix cleanup of uninitialized image layer --- bec_widgets/widgets/plots/image/image_base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()