diff --git a/avogadro/qtgui/hydrogentools.cpp b/avogadro/qtgui/hydrogentools.cpp index 3187889dbf..b7b5266b2d 100644 --- a/avogadro/qtgui/hydrogentools.cpp +++ b/avogadro/qtgui/hydrogentools.cpp @@ -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 badHIndices;