JAL-1179 note and patch for exceptions raised when jalview.viewmodel.AlignmentViewpor...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 25 Sep 2012 14:22:09 +0000 (15:22 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 25 Sep 2012 14:22:09 +0000 (15:22 +0100)
src/jalview/datamodel/AlignmentView.java

index a23aad5..662145e 100644 (file)
@@ -72,7 +72,7 @@ public class AlignmentView
   /**\r
    * Construct an alignmentView from a live jalview alignment view. Note -\r
    * hidden rows will be excluded from alignmentView\r
-   * \r
+   * Note: JAL-1179\r
    * @param alignment\r
    *          - alignment as referenced by an AlignViewport\r
    * @param columnSelection\r
@@ -104,7 +104,7 @@ public class AlignmentView
     // and record non-empty groups in group list.\r
     // record / sub-select selected region on the alignment view\r
     SequenceI[] selseqs;\r
-    if (selection != null)\r
+    if (selection != null && selection.getSize()>0)\r
     {\r
       List<SequenceI> sel = selection.getSequences(null);\r
       this.selected = new Vector();\r
@@ -174,7 +174,7 @@ public class AlignmentView
     {\r
       if (selseqs[i] != null)\r
       {\r
-        if (selection != null && !selectedRegionOnly)\r
+        if (selection != null && selection.getSize()>0 && !selectedRegionOnly)\r
         {\r
           sequences[csi].setGroupMembership(selected);\r
           selected.addElement(sequences[csi]);\r