From 3ba14d242c4746395e44dfa75ea467138bfa211e Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Sat, 3 Feb 2024 14:20:50 -0500 Subject: [PATCH] Fix crash Signed-off-by: Geoff Hutchison --- avogadro/calc/energymanager.cpp | 3 +++ avogadro/qtplugins/forcefield/forcefield.cpp | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/avogadro/calc/energymanager.cpp b/avogadro/calc/energymanager.cpp index 53751e45dc..925569d047 100644 --- a/avogadro/calc/energymanager.cpp +++ b/avogadro/calc/energymanager.cpp @@ -113,6 +113,9 @@ std::set EnergyManager::identifiersForMolecule( // check our models for compatibility for (auto m_model : m_models) { + if (m_model == nullptr) + continue; + // we can check easy things first // - is the molecule an ion based on total charge // - is the molecule a radical based on spin multiplicity diff --git a/avogadro/qtplugins/forcefield/forcefield.cpp b/avogadro/qtplugins/forcefield/forcefield.cpp index f4def95687..9dcf0fcbf6 100644 --- a/avogadro/qtplugins/forcefield/forcefield.cpp +++ b/avogadro/qtplugins/forcefield/forcefield.cpp @@ -65,8 +65,6 @@ Forcefield::Forcefield(QObject* parent_) m_gradientTolerance = settings.value("gradientTolerance", 1.0e-4).toDouble(); settings.endGroup(); - refreshScripts(); - // add the openbabel calculators in case they don't exist #ifdef BUILD_GPL_PLUGINS // These directly use Open Babel and are fast