Skip to content

Commit

Permalink
negative value was accepted (e.g. -1 was seen as the last element of …
Browse files Browse the repository at this point in the history
…the TABLE array)
  • Loading branch information
Juke34 committed Feb 16, 2024
1 parent 33e0de3 commit ed68ed0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Bio/Tools/CodonTable.pm
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ sub new {
sub id{
my ($self,$value) = @_;
if( defined $value) {
if ( not defined $TABLES[$value] or $TABLES[$value] eq '' or $TABLES[$value] eq "''") {
if ( not defined $TABLES[$value] or $TABLES[$value] eq '' or $TABLES[$value] eq "''" or $value < 0) {
$self->warn("Not a valid codon table ID [$value], using [1] instead ");
$value = 1;
}
Expand Down

0 comments on commit ed68ed0

Please sign in to comment.