Co-authored-by: ptosco <paolo.tosco@novartis.com>
This commit is contained in:
Paolo Tosco
2023-09-27 17:01:53 +02:00
committed by GitHub
parent b4e0f806ed
commit 0a3fe92528
2 changed files with 19 additions and 1 deletions

View File

@@ -3775,7 +3775,8 @@ bool MMFFMolProperties::getMMFFStretchBendParams(
getPeriodicTableRow(mol.getAtomWithIdx(idx2)->getAtomicNum()),
getPeriodicTableRow(mol.getAtomWithIdx(idx3)->getAtomicNum()));
}
res = (!(isDoubleZero((mmffStbnParams.second)->kbaIJK) &&
res = (mmffStbnParams.second &&
!(isDoubleZero((mmffStbnParams.second)->kbaIJK) &&
isDoubleZero((mmffStbnParams.second)->kbaKJI)));
}
if (res) {

View File

@@ -1070,6 +1070,22 @@ void testGithub224() {
BOOST_LOG(rdErrorLog) << " done" << std::endl;
}
void testGithub6728() {
BOOST_LOG(rdErrorLog) << "-------------------------------------" << std::endl;
BOOST_LOG(rdErrorLog)
<< " Testing github6728: crash due to missing stretch-bend params."
<< std::endl;
RWMol *mol = SmilesToMol("CC(C)(C)CO[H-]F");
TEST_ASSERT(mol);
MolOps::addHs(*mol);
TEST_ASSERT(DGeomHelpers::EmbedMolecule(*mol) >= 0);
auto field = MMFF::constructForceField(*mol);
TEST_ASSERT(field);
field->initialize();
delete mol;
delete field;
}
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
@@ -1098,4 +1114,5 @@ int main() {
testGithub162();
#endif
testGithub224();
testGithub6728();
}