From 9a51e8630e8b4a2978b07e7cc859c85c3e703c2e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 16 Sep 2015 15:03:47 +0200 Subject: HAFAS->new: Die if an unknown service is requested --- lib/Travel/Status/DE/HAFAS.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index c67ac8d..21b0684 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -108,6 +108,10 @@ sub new { $service = 'DB'; } + if ( defined $service and not exists $hafas_instance{$service} ) { + confess("The service '$service' is not supported"); + } + my $ref = { active_service => $service, developer_mode => $conf{developer_mode}, -- cgit v1.2.3