Check alAndColSel are not null
authoramwaterhouse <Andrew Waterhouse>
Thu, 10 Aug 2006 14:56:21 +0000 (14:56 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 10 Aug 2006 14:56:21 +0000 (14:56 +0000)
src/jalview/appletgui/TreePanel.java

index b3fc3b3..6f57160 100755 (executable)
@@ -122,19 +122,24 @@ public class TreePanel extends Frame implements ActionListener, ItemListener
     // create new alignmnt window with hidden regions (unhiding hidden regions yields unaligned seqs)\r
     // or create a selection box around columns in alignment view\r
     // test Alignment(SeqCigar[])\r
-    Object[] alAndColsel = tree.seqData.getAlignmentAndColumnSelection(av.\r
-        getGapCharacter());\r
-\r
-    if (alAndColsel != null && alAndColsel[0]!=null)\r
-     {\r
-       Alignment al = new Alignment( (SequenceI[]) alAndColsel[0]);\r
-       AlignFrame af = new AlignFrame(al,\r
-             av.applet,\r
-             "Original Data for Tree",\r
-             false);\r
-\r
-      af.viewport.setHiddenColumns( (ColumnSelection) alAndColsel[1] );\r
-     }\r
+    if(tree.seqData!=null)\r
+    {\r
+      Object[] alAndColsel = tree.seqData.getAlignmentAndColumnSelection(av.\r
+          getGapCharacter());\r
+\r
+      if (alAndColsel != null && alAndColsel[0] != null)\r
+      {\r
+        Alignment al = new Alignment( (SequenceI[]) alAndColsel[0]);\r
+        AlignFrame af = new AlignFrame(al,\r
+                                       av.applet,\r
+                                       "Original Data for Tree",\r
+                                       false);\r
+\r
+        af.viewport.setHiddenColumns( (ColumnSelection) alAndColsel[1]);\r
+      }\r
+    }\r
+    else\r
+      System.out.println("Original Tree Data not available");\r
   }\r
 \r
   class TreeLoader extends Thread\r