mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
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:
@@ -25,7 +25,14 @@ void fillPatterns(const SubstructLibrary &slib,
|
||||
for (unsigned int idx = start;
|
||||
idx < end;
|
||||
idx += numThreads) {
|
||||
fps[idx] = fph.makeFingerprint( *slib.getMol(idx).get() );
|
||||
auto mol = slib.getMol(idx);
|
||||
if (mol.get()) {
|
||||
fps[idx] = fph.makeFingerprint( *mol.get() );
|
||||
}
|
||||
else {
|
||||
// Make an empty FP
|
||||
fps[idx] = fph.makeFingerprint(ROMol());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user