From 49c4cb463129bc06de8d615ce4eca986e44d1ba6 Mon Sep 17 00:00:00 2001 From: Mike Sullivan Date: Fri, 15 Nov 2024 12:24:06 +0000 Subject: [PATCH] Only close LV model if it exists --- mantidimaging/gui/windows/live_viewer/presenter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mantidimaging/gui/windows/live_viewer/presenter.py b/mantidimaging/gui/windows/live_viewer/presenter.py index 34984d032b0..b26391c58b9 100644 --- a/mantidimaging/gui/windows/live_viewer/presenter.py +++ b/mantidimaging/gui/windows/live_viewer/presenter.py @@ -46,7 +46,8 @@ def __init__(self, view: LiveViewerWindowView, main_window: MainWindowView): def close(self) -> None: """Close the window.""" - self.model.close() + if self.model is not None: + self.model.close() self.model = None # type: ignore # Presenter instance to be destroyed -type can be inconsistent self.view = None # type: ignore # Presenter instance to be destroyed -type can be inconsistent