diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-17 21:29:51 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-17 21:29:51 +0200 |
commit | 298b099097ec9591022142a73198288476c567fd (patch) | |
tree | ae1d664c99163c2435ad0e9fd9bdb9d58321a80f /lib/Travelynx | |
parent | cbc1ac791c9e5829c1672088538fe5f5016fcce4 (diff) |
get_travel_distance: do not overwrite {to,from}_eva with undef
Diffstat (limited to 'lib/Travelynx')
-rwxr-xr-x | lib/Travelynx/Model/Journeys.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm index 1d1761b..6d59d44 100755 --- a/lib/Travelynx/Model/Journeys.pm +++ b/lib/Travelynx/Model/Journeys.pm @@ -1136,7 +1136,7 @@ sub get_travel_distance { "Journey $journey->{id} from_eva ($from_eva) is not part of polyline" ); for my $entry ( @{$route_ref} ) { - if ( $entry->[0] eq $from ) { + if ( $entry->[0] eq $from and $entry->[1] ) { $from_eva = $entry->[1]; $self->{log}->debug("... setting to $from_eva"); last; @@ -1151,7 +1151,7 @@ sub get_travel_distance { $self->{log}->debug( "Journey $journey->{id} to_eva ($to_eva) is not part of polyline"); for my $entry ( @{$route_ref} ) { - if ( $entry->[0] eq $to ) { + if ( $entry->[0] eq $to and $entry->[1] ) { $to_eva = $entry->[1]; $self->{log}->debug("... setting to $to_eva"); last; |