Skip to content

Commit 3b140c3

Browse files
committed
Null check molecules.
1 parent 011fe00 commit 3b140c3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ public Depiction depict(Iterable<IAtomContainer> mols, int nrow, int ncol) throw
337337
List<LayoutBackup> layoutBackups = new ArrayList<>();
338338
int molId = 0;
339339
for (IAtomContainer mol : mols) {
340+
if (mol == null)
341+
throw new NullPointerException("Null molecule provided!");
340342
setIfMissing(mol, MarkedElement.ID_KEY, "mol" + ++molId);
341343
layoutBackups.add(new LayoutBackup(mol));
342344
}

0 commit comments

Comments
 (0)