JAL-2590 patch for rendering eggnog trees with polytomies (also see
[jalview.git] / src / jalview / appletgui / TreeCanvas.java
index 48e9d64..272a2b3 100755 (executable)
@@ -261,10 +261,11 @@ public class TreeCanvas extends Panel implements MouseListener,
         g.fillRect(xend - 2, ypos - 2, 4, 4);
       }
 
-      int ystart = (int) (((SequenceNode) node.left()).ycount * chunk)
-              + offy;
-      int yend = (int) (((SequenceNode) node.right()).ycount * chunk)
+      int ystart = (int) (node.left() == null ? 0 : (((SequenceNode) node
+              .left()).ycount * chunk))
               + offy;
+      int yend = (int) (node.right() == null ? 0 : (((SequenceNode) node
+              .right()).ycount * chunk)) + offy;
 
       Rectangle pos = new Rectangle(xend - 2, ypos - 2, 5, 5);
       nodeHash.put(node, pos);