@Override
public ContactListI getContactListFor(AlignmentAnnotation _aa, int column)
{
+ if (_aa.annotations==null || column>=_aa.annotations.length || column<0)
+ {
+ return null;
+ }
ContactListI cl = cmholder.getContactListFor(_aa, column);
if (cl == null && _aa.groupRef != null)
{
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);