Skip to content

Commit

Permalink
Belt and braces - avoid future problems where the 2d/3d are null with…
Browse files Browse the repository at this point in the history
… wedge bonds.
  • Loading branch information
johnmay committed Jan 5, 2017
1 parent 72418be commit 012c8b7
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -856,6 +856,10 @@ private int[] rubricTetrahedral(int aidx) {

// fill in existing positions, including "fake" Z coordinate if wedges are being used
Point2d a2d = atom.getPoint2d();

// for safety in case the bond type (bond stereo) is set but no coords are
if (a2d == null && a3d == null) return null;

final float x0 = a3d != null ? (float) a3d.x : (float) a2d.x;
final float y0 = a3d != null ? (float) a3d.y : (float) a2d.y;
final float z0 = a3d != null ? (float) a3d.z : 0;
Expand Down

0 comments on commit 012c8b7

Please sign in to comment.