PolarizerEfficiency algorithm validation crash #38483
Labels
Added during Sprint
Tasks that were added after initial sprint planning
Bug
Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing)
ISIS Team: LSS
Issue and pull requests managed by the LSS subteam at ISIS
Reported By User
Issues that were found or highlighted by a user/scientist
SANS
Issues and pull requests related to SANS
Milestone
Original reporter: Dirk from the SANS Group at ISIS
Describe the bug
The
PolarizerEfficiency
algorithm includes some input validation to check that the size of the workspace group matches the number of spin states that have been passed in. If these do not match then we are currently not returning early to prevent the rest of the validation from continuing. This can cause a crash as in the steps that follow we try to look up the workspace in the group that matches the00
spin state, but this may be at an index that doesn't exist in the workspace group.To get the crash the algorithm seems to need to be run from the dialog rather than from a script, otherwise you just see the exception (Exception: WorkspaceGroup - index out of range. Requested=3, current size=2) logged in the messages pane.
To Reproduce
To see the exception logged in the messages pane, run:
Having done this, you can reproduce the crash by running the
PolarizerEfficiency
algorithm from the algorithm dialog using the inputs given above.Expected behavior
We should display a suitable error message and Mantid shouldn't crash.
Platform/Version (please complete the following information):
Additional context
I think we just need to change this if statement in the
validateInputs
method:to be:
And add appropriate test coverage.
The text was updated successfully, but these errors were encountered: