summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-02-01 10:59:46 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-02-01 10:59:46 +0100
commita29568711f1fd454c1af2f30badfdbcf94ccd921 (patch)
tree6817234585bb7d5921af1fb419083a6b68c896e4
parentaa7a7db2bcd6ae8cf0caef37d436bcb2ae162d5b (diff)
fix uninitialized value warning when handling odd trains (trains without type)
-rwxr-xr-xlib/Travelynx.pm7
1 files 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