Skip to content

Commit

Permalink
Merge pull request #1493 from Makiah/master
Browse files Browse the repository at this point in the history
Avoid segfaulting while manipulating carbon bonds/hydrogens
  • Loading branch information
ghutchis authored Dec 4, 2023
2 parents 219b47d + 11bff12 commit 80634d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions avogadro/qtgui/hydrogentools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ void HydrogenTools::adjustHydrogens(RWAtom& atom, Adjustment adjustment)
// convenience
RWMolecule* molecule = atom.molecule();

if (molecule == nullptr)
return;

if (doRemove) {
// get the list of hydrogens connected to this
std::vector<size_t> badHIndices;
Expand Down

0 comments on commit 80634d9

Please sign in to comment.