From f3591508eeb2e21b0fda8f8a89cca8be59829fd9 Mon Sep 17 00:00:00 2001
From: Graham McVicker <mcvicker@sanger.ac.uk>
Date: Fri, 16 Jan 2004 09:30:19 +0000
Subject: [PATCH] seq_region_start|end could have returned undef
 inappropraitely when one (but not both) of the features end|start was
 undefined

---
 modules/Bio/EnsEMBL/Feature.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/Bio/EnsEMBL/Feature.pm b/modules/Bio/EnsEMBL/Feature.pm
index d1553a6227..7d557df94e 100644
--- a/modules/Bio/EnsEMBL/Feature.pm
+++ b/modules/Bio/EnsEMBL/Feature.pm
@@ -708,12 +708,12 @@ sub seq_region_start {
   my $slice = $self->{'slice'};
 
   return undef if(!$slice);
-  return undef if(!defined($self->{'start'}));
-  return undef if(!defined($self->{'end'}));
 
   if($slice->strand == 1) {
+    return undef if(!defined($self->{'start'}));
     return $slice->start() + $self->{'start'} - 1;
   } else {
+    return undef if(!defined($self->{'end'}));
     return $slice->end() - $self->{'end'} + 1;
   }
 }
@@ -724,7 +724,7 @@ sub seq_region_start {
   Arg [1]    : none
   Example    : print $feature->seq_region_end();
   Description: Convenience method which returns the absolute end of this
-               feature on the seq_region, as opposed to the relative (slice) 
+               feature on the seq_region, as opposed to the relative (slice)
                position.
 
                Returns undef if this feature is not on a slice.
@@ -739,12 +739,12 @@ sub seq_region_end {
   my $slice = $self->{'slice'};
 
   return undef if(!$slice);
-  return undef if(!defined($self->{'start'}));
-  return undef if(!defined($self->{'end'}));
 
   if($slice->strand == 1) {
+    return undef if(!defined($self->{'end'}));
     return $slice->start() + $self->{'end'} - 1;
   } else {
+    return undef if(!defined($self->{'start'}));
     return $slice->end() - $self->{'start'} + 1;
   }
 }
-- 
GitLab