/**
*
- * @return automatically calculated consensus row
+ * @return automatically calculated consensus row note: the row is a stub if a
+ * consensus calculation has not yet been performed on the group
*/
public AlignmentAnnotation getConsensus()
{
.getCharAt(position) : av.getAlignment().getSeqrep()
.getCharAt(position)))
: (currentGroup != null && currentGroup.getConsensus() != null
- && position >= currentGroup.getStartRes() && position <= currentGroup
- .getEndRes()) ? currentGroup.getConsensus().annotations[position].displayCharacter
+ && position >= currentGroup.getStartRes()
+ && position <= currentGroup.getEndRes() && currentGroup
+ .getConsensus().annotations.length > position) ? currentGroup
+ .getConsensus().annotations[position].displayCharacter
.charAt(0)
: av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter
.charAt(0);