From c2aee0a161633c889d5e98cf9e066a6e730a3363 Mon Sep 17 00:00:00 2001 From: Eugene Kulesha <ek@ebi.ac.uk> Date: Fri, 31 Oct 2008 16:41:46 +0000 Subject: [PATCH] check a feature has a valid start and end --- modules/Bio/EnsEMBL/Feature.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/Bio/EnsEMBL/Feature.pm b/modules/Bio/EnsEMBL/Feature.pm index a571499391..7193898250 100644 --- a/modules/Bio/EnsEMBL/Feature.pm +++ b/modules/Bio/EnsEMBL/Feature.pm @@ -124,8 +124,12 @@ 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'); } } -- GitLab