Skip to content

Commit

Permalink
A quick fix. This class will soon be removed, so no peer review needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Dec 9, 2011
1 parent 3c1086a commit 9e97f2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/org/openscience/cdk/MoleculeSet.java
Expand Up @@ -141,12 +141,12 @@ public Iterable<IAtomContainer> molecules() {
* @param number The position of the Molecule to be returned.
* @return The Molecule at position <code>number</code> .
*/
public IMolecule getMolecule(int number)
{
return (IMolecule)super.getAtomContainer(number);
public IMolecule getMolecule(int number) {
IAtomContainer container = super.getAtomContainer(number);
if (container instanceof IMolecule) return (IMolecule)container;
return getBuilder().newInstance(IMolecule.class, container);
}


/**
* Returns the number of Molecules in this Container.
*
Expand Down

0 comments on commit 9e97f2d

Please sign in to comment.