Avoid a segfault in CoordGen when a double bond has stereo spec but no stereo atoms (#8415)

* avoid a segfault in CoordGen when a double bond has stereo spec but no stereo atoms

* changes in response to review

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
This commit is contained in:
Paolo Tosco
2025-04-08 09:32:59 +02:00
committed by GitHub
parent 5817e52db2
commit d8dc968eaa
2 changed files with 19 additions and 1 deletions

View File

@@ -154,8 +154,10 @@ unsigned int addCoords(T &mol, const CoordGenParams *params = nullptr) {
auto obnd = *bndit;
if (obnd->getBondType() != Bond::DOUBLE ||
obnd->getStereo() <= Bond::STEREOANY ||
obnd->getStereo() > Bond::STEREOTRANS)
obnd->getStereo() > Bond::STEREOTRANS ||
obnd->getStereoAtoms().size() < 2) {
continue;
}
sketcherMinimizerBondStereoInfo sinfo;
sinfo.atom1 = ats[obnd->getStereoAtoms()[0]];