ensure successive matches to a regex have distinct annotation name (indice suffix...
[jalview.git] / src / jalview / appletgui / TreePanel.java
index f865bbd..6ab01aa 100755 (executable)
@@ -106,9 +106,9 @@ public class TreePanel
     this.pwtype = pwtype;
 
 
+    treeCanvas = new TreeCanvas(av, scrollPane);
     TreeLoader tl = new TreeLoader(newTree);
     tl.start();
-    treeCanvas = new TreeCanvas(av, scrollPane);
     embedMenuIfNeeded(treeCanvas);
     scrollPane.add(treeCanvas, BorderLayout.CENTER);
   }
@@ -120,8 +120,14 @@ public class TreePanel
     // test Alignment(SeqCigar[])
     if (tree.seqData != null)
     {
-      Object[] alAndColsel = tree.seqData.getAlignmentAndColumnSelection(av.
-          getGapCharacter());
+      char gc = '-';
+      try {
+        // we try to get the associated view's gap character
+        // but this may fail if the view was closed...
+        gc = av.
+        getGapCharacter();
+      } catch (Exception ex) {};
+      Object[] alAndColsel = tree.seqData.getAlignmentAndColumnSelection(gc);
 
       if (alAndColsel != null && alAndColsel[0] != null)
       {