Skip to content

Commit

Permalink
Fixed NullPointerException by creating an empty list of generators, a…
Browse files Browse the repository at this point in the history
…nd return a list too, rather than a null
  • Loading branch information
egonw committed May 19, 2012
1 parent 32ca540 commit d13b1a2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@


import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;


import javax.vecmath.Point2d; import javax.vecmath.Point2d;
Expand Down Expand Up @@ -121,6 +123,7 @@ public MoleculeSetRenderer(List<IGenerator<IAtomContainer>> generators, IFontMan
rendererModel.registerParameters(generator); rendererModel.registerParameters(generator);
} }
atomContainerRenderer = new AtomContainerRenderer(generators, fontManager); atomContainerRenderer = new AtomContainerRenderer(generators, fontManager);
this.generators = Collections.emptyList();
this.setup(); this.setup();
} }


Expand Down Expand Up @@ -284,8 +287,7 @@ public double calculateScaleForBondLength(double modelBondLength) {
} }


public List<IGenerator<IMoleculeSet>> getGenerators() { public List<IGenerator<IMoleculeSet>> getGenerators() {
// TODO Auto-generated method stub return new ArrayList<IGenerator<IMoleculeSet>>(generators);
return null;
} }


} }

0 comments on commit d13b1a2

Please sign in to comment.