From fbf083f14c4c98fb9203d52f8e1eb5d7b57cd7ad Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 8 May 2007 13:47:57 +0000 Subject: [PATCH] check for null annotations --- src/jalview/gui/AlignFrame.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 3c74f43..5b56680 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1050,7 +1050,7 @@ public class AlignFrame } /** - * + * * @return alignment objects for all views */ AlignmentI[] getViewAlignments() @@ -1607,7 +1607,7 @@ public class AlignFrame } } if (!newAlignment) { - + // propagate alignment changed. viewport.setEndSeq(alignment.getHeight()); if (annotationAdded) @@ -1640,7 +1640,7 @@ public class AlignFrame buildSortByAnnotationScoresMenu(); } viewport.firePropertyChange("alignment", null, alignment.getSequences()); - + } else { AlignFrame af = new AlignFrame(alignment, DEFAULT_WIDTH, DEFAULT_HEIGHT); String newtitle = new String("Copied sequences"); @@ -3129,6 +3129,11 @@ public class AlignFrame */ public void buildSortByAnnotationScoresMenu() { + if(viewport.alignment.getAlignmentAnnotation()==null) + { + return; + } + if (viewport.alignment.getAlignmentAnnotation().hashCode()!=_annotationScoreVectorHash) { sortByAnnotScore.removeAll(); @@ -3154,6 +3159,9 @@ public class AlignFrame } sortByAnnotScore.setVisible(scoreSorts.size()>0); scoreSorts.clear(); + + _annotationScoreVectorHash = + viewport.alignment.getAlignmentAnnotation().hashCode(); } } -- 1.7.10.2