Skip to content
Snippets Groups Projects
Commit 2a8b5de8 authored by Eugene Kulesha's avatar Eugene Kulesha
Browse files

check a feature has a valid start and end

parent 629533bb
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment