CCP-NC / magresview-2

MagresView 2.0 - NMR crystallography visualisation app
https://ccp-nc.github.io/magresview-2/
MIT License
0 stars 2 forks source link

Plots: negative xrange results in application crash when Auto is selected #23

Open jkshenton opened 2 months ago

jkshenton commented 2 months ago

If I load a magres file, go to the plots tab and try to enter a negative number for either the xmin or xmax field, the application immediately crashes with an error:

TypeError: Cannot read properties of undefined (reading 'peaks')
    at d (MVPlot1D.js:47:39)
    at wn (MVPlot1D.js:296:22)
    at oo (react-dom.production.min.js:157:137)
    at Vo (react-dom.production.min.js:180:154)
    at Xs (react-dom.production.min.js:269:343)
    at Au (react-dom.production.min.js:250:347)
    at Nu (react-dom.production.min.js:250:278)
    at Cu (react-dom.production.min.js:250:138)
    at bu (react-dom.production.min.js:243:163)
    at react-dom.production.min.js:123:115

I think this only happens when a) Auto is set to true and b) either x min or x max is blank for some time (i.e. you delete the current entry and attempt to type in something)