Permalink
Browse files

Fixed NullPointerException by creating an empty list of generators, a…

…nd return a list too, rather than a null
  • Loading branch information...
1 parent 32ca540 commit d13b1a24d01d3c7beb40f9e19e38fc084f47f628 @egonw egonw committed Jan 26, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/main/org/openscience/cdk/renderer/MoleculeSetRenderer.java
@@ -23,6 +23,8 @@
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import javax.vecmath.Point2d;
@@ -121,6 +123,7 @@ public MoleculeSetRenderer(List<IGenerator<IAtomContainer>> generators, IFontMan
rendererModel.registerParameters(generator);
}
atomContainerRenderer = new AtomContainerRenderer(generators, fontManager);
+ this.generators = Collections.emptyList();
this.setup();
}
@@ -284,8 +287,7 @@ public double calculateScaleForBondLength(double modelBondLength) {
}
public List<IGenerator<IMoleculeSet>> getGenerators() {
- // TODO Auto-generated method stub
- return null;
+ return new ArrayList<IGenerator<IMoleculeSet>>(generators);
}
}

0 comments on commit d13b1a2

Please sign in to comment.