JAL-547 fix NPE when no selection available
authorJim Procter <jprocter@issues.jalview.org>
Fri, 20 Oct 2017 14:28:08 +0000 (15:28 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 20 Oct 2017 14:28:08 +0000 (15:28 +0100)
examples/groovy/PIDmatrix.groovy

index 3ff4b39..b97abcc 100644 (file)
@@ -62,7 +62,7 @@ void printSimilarityMatrix(boolean selview=false, boolean includeids=true, Simil
 
   jalview.datamodel.AlignmentView seqStrings = av.getAlignmentView(selview)
 
-  if (!selview) {
+  if (!selview || av.getSelectionGroup()==null) {
     start = 0
     end = av.getAlignment().getWidth()
     seqs = av.getAlignment().getSequencesArray()
@@ -96,4 +96,4 @@ void printSimilarityMatrix(boolean selview=false, boolean includeids=true, Simil
 
     print "\n"
   }
-}
+}
\ No newline at end of file