null pointer exception and warning for update of tree
authorjprocter <Jim Procter>
Wed, 24 Oct 2007 10:59:10 +0000 (10:59 +0000)
committerjprocter <Jim Procter>
Wed, 24 Oct 2007 10:59:10 +0000 (10:59 +0000)
src/jalview/io/vamsas/Tree.java

index 28e3c2d..a45c98d 100644 (file)
@@ -226,14 +226,18 @@ public class Tree extends DatastoreItem
    * 
    * Update jalview newick representation with TreeNode map
    * 
-   * @param tp
-   *                the treepanel that this tree is bound to.
+   * @param tp the treepanel that this tree is bound to.
    */
   public void UpdateSequenceTreeMap(TreePanel tp)
   {
     if (tp == null || tree == null)
       return;
     Vector leaves = new Vector();
+    if (tp.getTree()==null)
+    {
+      Cache.log.warn("Not updating SequenceTreeMap for "+tree.getVorbaId());
+      return;
+    }
     tp.getTree().findLeaves(tp.getTree().getTopNode(), leaves);
     Treenode[] tn = tree.getTreenode(); // todo: select nodes for this
                                         // particular tree