From a29568711f1fd454c1af2f30badfdbcf94ccd921 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 1 Feb 2020 10:59:46 +0100 Subject: fix uninitialized value warning when handling odd trains (trains without type) --- lib/Travelynx.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 117724f..750de35 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -2302,8 +2302,11 @@ sub startup { { # Drunken API, sail with care. Both date formats are used interchangeably - if ( $suggestion->{depDate} eq $date_yy - or $suggestion->{depDate} eq $date_yyyy ) + if ( + $suggestion->{depDate} + and ( $suggestion->{depDate} eq $date_yy + or $suggestion->{depDate} eq $date_yyyy ) + ) { # Train numbers are not unique, e.g. IC 149 refers both to the # InterCity service Amsterdam -> Berlin and to the InterCity service -- cgit v1.2.3