From: Jim Procter Date: Wed, 4 Dec 2024 16:32:33 +0000 (+0000) Subject: JAL-4333 - prophylactically check we have not run out of aligned codons - increase... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3f848bf2699737ea0daea99f4b5d2b68e09da06b;p=jalview.git JAL-4333 - prophylactically check we have not run out of aligned codons - increase width if we have.. --- diff --git a/src/jalview/analysis/Dna.java b/src/jalview/analysis/Dna.java index 9a99b69..a4dc5d0 100644 --- a/src/jalview/analysis/Dna.java +++ b/src/jalview/analysis/Dna.java @@ -590,10 +590,11 @@ public class Dna { /* * Compare this codon's base positions with those currently aligned to - * this column in the translation. + * this column in the translation. Always check we've not run out of existing aligned codons ! */ - final int compareCodonPos = compareCodonPos(alignedCodon, - alignedCodons[aspos]); + final int compareCodonPos = (aspos < alignedCodons.length) + ? compareCodonPos(alignedCodon, alignedCodons[aspos]) + : -1; switch (compareCodonPos) { case -1: