Skip to content

Commit 0a7b90b

Browse files
fix: fixed crash on cv layout (#177)
1 parent d2c92c2 commit 0a7b90b

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

dist/helpers/cfg.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ const btnCmdMpyPeak = function (layoutSt, mpySt) {
2222
let smExtextVal = false;
2323
if (multiplicities) {
2424
const selectedMultiplicity = multiplicities[curveIdx];
25-
const {
26-
smExtext
27-
} = selectedMultiplicity;
28-
smExtextVal = smExtext;
25+
if (selectedMultiplicity) {
26+
const {
27+
smExtext
28+
} = selectedMultiplicity;
29+
smExtextVal = smExtext;
30+
}
2931
}
3032
return btnCmdMpy(layoutSt) || !smExtextVal;
3133
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@complat/react-spectra-editor",
3-
"version": "1.0.0-rc20",
3+
"version": "1.0.0-rc20.patch-1",
44
"description": "An editor to View and Edit Chemical Spectra data (NMR, IR and MS, CV, UIVIS, XRD).",
55
"repository": {
66
"type": "git",

src/helpers/cfg.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ const btnCmdMpyPeak = (layoutSt, mpySt, curveIdx = 0) => {
3333
let smExtextVal = false;
3434
if (multiplicities) {
3535
const selectedMultiplicity = multiplicities[curveIdx];
36-
const { smExtext } = selectedMultiplicity;
37-
smExtextVal = smExtext;
36+
if (selectedMultiplicity) {
37+
const { smExtext } = selectedMultiplicity;
38+
smExtextVal = smExtext;
39+
}
3840
}
3941
return btnCmdMpy(layoutSt) || !smExtextVal;
4042
};

0 commit comments

Comments
 (0)