ensure input data can be recovered for tree and PCA even if alignment view was closed
[jalview.git] / src / jalview / appletgui / PCAPanel.java
index a5268bf..ee54478 100755 (executable)
@@ -219,8 +219,14 @@ public class PCAPanel
     // 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 = seqstrings.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 = seqstrings.getAlignmentAndColumnSelection(gc);
 
     if (alAndColsel != null && alAndColsel[0] != null)
     {