Skip to content

Commit

Permalink
Illegal argument when the new atom already exists in the molecule.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Jul 20, 2016
1 parent 38b2f34 commit 706c84b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ public static boolean replaceAtomByAtom(final IAtomContainer container, final IA
container.setAtom(i, newAtom);
atomremap.put(oldAtom, newAtom);
} else {
if (atom == newAtom)
throw new IllegalArgumentException("Cannot replace atom with one from the same molecule.");
atomremap.put(atom, atom);
}
}
Expand Down

0 comments on commit 706c84b

Please sign in to comment.