Skip to content

Commit

Permalink
#485 The error occurs when trying to undo the delete action for a str…
Browse files Browse the repository at this point in the history
…ucture with stereo bonds
  • Loading branch information
AndreiMazol committed Apr 20, 2021
1 parent 0504e5b commit dcb9b69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ketcher-react/src/script/chem/struct/fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ Fragment.STEREO_FLAG = {
*/
function calcStereoFlag(struct, stereoAids) {
if (!stereoAids || stereoAids.length === 0) return null
const stereoLabel = struct.atoms.get(stereoAids[0]).stereoLabel // {string | null} "<abs|and|or>-<group>"
const atomId = stereoAids[0]
const atom = struct.atoms.get(atomId)
if (!atom) return null
const stereoLabel = atom.stereoLabel // {string | null} "<abs|and|or>-<group>"

const hasAnotherLabel = stereoAids
.map(aid => struct.atoms.get(aid))
Expand Down

0 comments on commit dcb9b69

Please sign in to comment.