Merge branch 'develop' into patch/JAL-4281_idwidthandannotHeight_in_project
[jalview.git] / test / jalview / datamodel / PAEContactMatrixTest.java
index bdfa5a3..fa7aca5 100644 (file)
@@ -116,7 +116,11 @@ public class PAEContactMatrixTest
     AlignmentI alForSeq = new Alignment(new SequenceI[] { alseq });
     newaa = AlignmentUtils.addReferenceAnnotationTo(alForSeq, alseq, newaa,
             null);
-    ContactListI alcl = alForSeq.getContactListFor(newaa, 1);
+    // check for null on out of bounds
+    ContactListI alcl = alForSeq.getContactListFor(newaa, newaa.annotations.length);
+    assertNull(alcl,"Should've gotten null!");
+    // now check for mapping
+    alcl = alForSeq.getContactListFor(newaa, 1);
     assertNotNull(alcl);
     mappedCl = alcl.getMappedPositionsFor(0, 4);
     assertNotNull(mappedCl);