Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added null check to avoid NPE when no model is present

  • Loading branch information...
commit d035ed33e38e74a48dfff6ee2ac036c34d0a84b4 1 parent a4fcb1e
Arvid Berg authored committed
View
3  ...nals/trunk/org.openscience.cdk.renderextra/src/org/openscience/cdk/renderer/Renderer.java
@@ -141,7 +141,8 @@ public Renderer(List<IGenerator> generators,
public void setup(IChemModel chemModel, Rectangle screen) {
this.setScale(chemModel);
Rectangle2D bounds = Renderer.calculateBounds(chemModel);
- this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY());
+ if(bounds != null)
+ this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY());
this.drawCenter = new Point2d(screen.getCenterX(), screen.getCenterY());
this.setup();
}
Please sign in to comment.
Something went wrong with that request. Please try again.