From 68bc276bff544355180437c6bb15e9a495027bab Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 26 Dec 2022 20:47:43 +0100 Subject: [PATCH] connecting trains: fix warning when encountering unknown platforms --- lib/Travelynx/Controller/Traveling.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 90f858c..aa25e5c 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -206,9 +206,13 @@ sub get_connecting_trains_p { $train->{message_id} = { map { $_ => 1 } @message_ids }; my $interchange_duration; if ( exists $stationinfo->{i} ) { - $interchange_duration - = $stationinfo->{i}{$arr_platform} - { $train->platform }; + if ( defined $arr_platform + and defined $train->platform ) + { + $interchange_duration + = $stationinfo->{i}{$arr_platform} + { $train->platform }; + } $interchange_duration //= $stationinfo->{i}{"*"}; } if ( defined $interchange_duration ) {