From 41af1792868fe17c6563545a6ca462ba6c84941e Mon Sep 17 00:00:00 2001 From: Jason Stajich Date: Thu, 12 Oct 2017 12:49:29 -0700 Subject: [PATCH] Fix bug 253 testing for defined Fix bug #253 where need to use `defined` instead of just a true/false test since the value can be 0 --- Bio/Restriction/Enzyme.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Bio/Restriction/Enzyme.pm b/Bio/Restriction/Enzyme.pm index c72bfa227..0a75b571a 100644 --- a/Bio/Restriction/Enzyme.pm +++ b/Bio/Restriction/Enzyme.pm @@ -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); } @@ -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; } } -- 2.11.4.GIT