mantidproject / mslice

Source code for Mantid MSlice
http://mantidproject.github.io/mslice
1 stars 2 forks source link

Set intensity from action type #903

Closed robertapplin closed 1 year ago

robertapplin commented 1 year ago

Description of work: This PR fixes a crash caused by caching a string rather than an action object. This causes a crash when calling setChecked on the string rather than on the action object.

To test:

  1. Create a cut plot
  2. change intensity to Chi"(Q,E) but click on cancel
  3. There should be no crash. The intensity should remain the same

Part of #854

MialLewis commented 1 year ago

The fix as is solves the exception in question, but causes an error to be thrown in a few other places. For me following this PR changing the intensity on any plot causes a crash.

I've pushed a change which I suggest as an alternative fix.

The code I've changed here is a hangover from when action objects themselves used to be cached that slipped through the net.