ensure input data can be recovered for tree and PCA even if alignment view was closed
[jalview.git] / src / jalview / gui / TreePanel.java
index 72bdbf1..762ad58 100755 (executable)
@@ -410,8 +410,14 @@ public class TreePanel
     // create new alignmnt window with hidden regions (unhiding hidden regions yields unaligned seqs)
     // or create a selection box around columns in alignment view
     // test Alignment(SeqCigar[])
-    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)
     {