Skip to content

Commit

Permalink
Fix bug 253 testing for defined
Browse files Browse the repository at this point in the history
Fix bug #253 where need to use `defined` instead of just a true/false test since the value can be 0
  • Loading branch information
hyphaltip authored Oct 12, 2017
1 parent 2783085 commit 41af179
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Bio/Restriction/Enzyme.pm
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ sub new {

# create the cut site if appropriate/this is a kludge due to
# the base.pm format in the new B:R order...
if ( $cut and $cut <= length $site) {
if ( defined $cut and $cut <= length $site) {
$site = substr($site, 0, $cut).'^'.substr($site, $cut);
}

Expand Down Expand Up @@ -1124,11 +1124,11 @@ sub overhang_seq {

return '' if $self->overhang eq 'blunt' ;

unless ($self->{_cut} && $self->{_rc_cut}) {
unless (defined $self->{_cut} && defined $self->{_rc_cut}) {
# lets just check that we really can't figure it out
$self->cut;
$self->complementary_cut;
unless ($self->{_cut} && $self->{_rc_cut}) {
unless (defined $self->{_cut} && defined $self->{_rc_cut}) {
return;
}
}
Expand Down

0 comments on commit 41af179

Please sign in to comment.