Fixes crashes when using bad smiles in the cached smiles holders (#3798)

* Fixes #3797

* Update Code/GraphMol/SubstructLibrary/SubstructLibrary.cpp

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>

* Update test to include positive and negative results

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
This commit is contained in:
Brian Kelley
2021-02-15 04:49:19 -05:00
committed by greg landrum
parent 8e6a96e392
commit 9100096102
4 changed files with 47 additions and 4 deletions

View File

@@ -125,6 +125,9 @@ void SubSearcher(const ROMol &in_query, const Bits &bits,
// returned molecule!
const boost::shared_ptr<ROMol> &m = mols.getMol(idx);
ROMol *mol = m.get();
if(!mol){
continue;
}
if (needs_rings && (!mol->getRingInfo() || !mol->getRingInfo()->isInitialized())) {
// I have no idea what happens when symmetrizeSSSR gets called
// on the same molecule twice in two threads.