Skip to content

Commit

Permalink
Avoid segfaulting while manipulating carbon bonds and associated hydr…
Browse files Browse the repository at this point in the history
…ogens

Signed-off-by: Makiah Bennett <[email protected]>
  • Loading branch information
Makiah committed Dec 4, 2023
1 parent 219b47d commit 11bff12
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 11bff12

Please sign in to comment.