Navigation Menu

Skip to content

Commit

Permalink
If clone fails (which it won't - IAtomContainer should not have decla…
Browse files Browse the repository at this point in the history
…red the exception thrown) then trail is null.. and we'll have NPE within the mutate(trial) call. This is better handled with an IllegalStateException.
  • Loading branch information
johnmay committed May 16, 2017
1 parent 02f82da commit d56977d
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -73,10 +73,9 @@ public IAtomContainer proposeStructure() {
logger.debug("RandomGenerator->proposeStructure() Start");
do {
try {
trial = (IAtomContainer) molecule.clone();
trial = molecule.clone();
} catch (CloneNotSupportedException e) {
logger.error("Could not clone IAtomContainer!" + e.getMessage());
trial = null;
throw new IllegalStateException("Could not clone IAtomContainer!" + e.getMessage());
}
mutate(trial);
if (logger.isDebugEnabled()) {
Expand Down

0 comments on commit d56977d

Please sign in to comment.