From: jprocter Date: Tue, 25 Sep 2012 14:22:09 +0000 (+0100) Subject: JAL-1179 note and patch for exceptions raised when jalview.viewmodel.AlignmentViewpor... X-Git-Tag: Jalview_2_9~289 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cd05157564b53f68ca9eb3ade15d0e687b57572d;p=jalview.git JAL-1179 note and patch for exceptions raised when jalview.viewmodel.AlignmentViewport.getAlignmentView() called with non-null selection that contains no sequences. Needed for JAL-1031 and JAL-1032 --- diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index a23aad5..662145e 100644 --- a/src/jalview/datamodel/AlignmentView.java +++ b/src/jalview/datamodel/AlignmentView.java @@ -72,7 +72,7 @@ public class AlignmentView /** * Construct an alignmentView from a live jalview alignment view. Note - * hidden rows will be excluded from alignmentView - * + * Note: JAL-1179 * @param alignment * - alignment as referenced by an AlignViewport * @param columnSelection @@ -104,7 +104,7 @@ public class AlignmentView // and record non-empty groups in group list. // record / sub-select selected region on the alignment view SequenceI[] selseqs; - if (selection != null) + if (selection != null && selection.getSize()>0) { List sel = selection.getSequences(null); this.selected = new Vector(); @@ -174,7 +174,7 @@ public class AlignmentView { if (selseqs[i] != null) { - if (selection != null && !selectedRegionOnly) + if (selection != null && selection.getSize()>0 && !selectedRegionOnly) { sequences[csi].setGroupMembership(selected); selected.addElement(sequences[csi]);