summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/IRIS.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index e20d758..1e39377 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -49,6 +49,12 @@ sub new {
$self->{nodes}{station} = ( $xml_st->findnodes('//station') )[0];
+ if ( not $self->{node}->{station} ) {
+ $self->{errstr}
+ = "The station '$opt{station}' has no associated timetable";
+ return $self;
+ }
+
my $dt_req = $self->{datetime}->clone;
for ( 1 .. 3 ) {
$self->get_timetable( $self->{nodes}{station}->getAttribute('eva'),