From 15cc92cbee66b0d3c7bc0da6703678d3bf0dc6b5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 18 Mar 2020 21:38:46 +0100 Subject: Result: Handle undefined type or train_no --- lib/Travel/Status/DE/IRIS/Result.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm index d5c4845..2b9adaa 100644 --- a/lib/Travel/Status/DE/IRIS/Result.pm +++ b/lib/Travel/Status/DE/IRIS/Result.pm @@ -670,8 +670,9 @@ sub info { sub line { my ($self) = @_; - return - sprintf( '%s %s', $self->{type}, $self->{line_no} // $self->{train_no} ); + return sprintf( '%s %s', + $self->{type} // 'Zug', + $self->{line_no} // $self->{train_no} // '-' ); } sub route_pre { -- cgit v1.2.3