From cd05157564b53f68ca9eb3ade15d0e687b57572d Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 25 Sep 2012 15:22:09 +0100 Subject: [PATCH] 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 --- src/jalview/datamodel/AlignmentView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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]); -- 1.7.10.2