Skip to content

Spectrum Viewer: Deleteing all ROIs then opening Fitting Tab gives KeyError #3123

@MikeSullivan7

Description

@MikeSullivan7

Steps To Reproduce

  • Load data and open Spectrum Viewer
  • Delete all ROIs
  • Click on "fitting" tab

Current Behaviour

KeyError appears

Expected Behaviour

No error should appear and the Fitting tab should not display data

Context

Failure Logs

2026-04-22 12:38:52,640 [mantidimaging.gui.windows.main.view:L672] ERROR: Traceback (most recent call last):
  File "C:\Users\ddb29996\mantidimaging\mantidimaging\gui\windows\spectrum_viewer\fitting_form.py", line 67, in showEvent
    self.presenter.handle_activated()
  File "C:\Users\ddb29996\mantidimaging\mantidimaging\gui\windows\spectrum_viewer\fitting_form.py", line 118, in handle_activated
    self.update_roi_on_fitting_thumbnail()
  File "C:\Users\ddb29996\mantidimaging\mantidimaging\gui\windows\spectrum_viewer\fitting_form.py", line 166, in update_roi_on_fitting_thumbnail
    roi_widget = self.spectrum_viewer.spectrum_widget.roi_dict[self.view.roiSelectionWidget.current_roi_name]
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: ''

2026-04-22 12:38:52,640 [mantidimaging.gui.mvp_base.view:L46] ERROR: show_error_dialog(): Uncaught exception KeyError: ''

Screenshot(s)

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions