summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-09-03 17:58:12 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-09-03 17:58:12 +0200
commit3b9db4bfd4cbfef06dfbb346755e56c211985281 (patch)
tree69e275924323201c88e855507285c10fbd68e18f /lib
parentdd151dc6869b9d4945a9dd2fa15b6afc3e89875f (diff)
get_connecting_trains_p: handle uninitialized arr_countdown
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 27f8ee3..5bfe48a 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -79,9 +79,11 @@ sub get_connecting_trains_p {
my $can_check_in = not $arr_epoch || ( $arr_countdown // 1 ) < 0;
$self->iris->get_departures_p(
- station => $eva,
- lookbehind => 10,
- lookahead => $can_check_in ? 40 : ( ${arr_countdown} / 60 + 40 ),
+ station => $eva,
+ lookbehind => 10,
+ lookahead => $can_check_in
+ ? 40
+ : ( ( ${arr_countdown} // 0 ) / 60 + 40 ),
with_related => 1
)->then(
sub {