From 2a8b5de887fa5d5939f8deafc4ea3cc5b337d300 Mon Sep 17 00:00:00 2001 From: Eugene Kulesha <ek@ebi.ac.uk> Date: Fri, 31 Oct 2008 16:31:22 +0000 Subject: [PATCH] check a feature has a valid start and end --- modules/Bio/EnsEMBL/Feature.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/Bio/EnsEMBL/Feature.pm b/modules/Bio/EnsEMBL/Feature.pm index 700ee05582..c3c1281822 100644 --- a/modules/Bio/EnsEMBL/Feature.pm +++ b/modules/Bio/EnsEMBL/Feature.pm @@ -122,9 +122,13 @@ sub new { } if(defined($start) && defined($end)) { - if($end+1 < $start) { - throw('Start must be less than or equal to end+1'); - } + if (($start =~ /\d+/) && ($end =~ /\d+/)) { + if($end+1 < $start) { + throw('Start must be less than or equal to end+1'); + } + } else { + throw('Start and end must be integers'); + } } return bless({'start' => $start, -- GitLab