From fe6340abeb2b1b483ac6ed346474676f3984bdda Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 26 Dec 2019 21:39:24 +0100 Subject: Handle undefined user data in conncetion suggestion with no previous journey Closes #30 --- lib/Travelynx.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 3cfc675..de6b1bc 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -2397,7 +2397,9 @@ sub startup { $eva = $status->{arr_eva}; $exclude_via = $status->{dep_name}; $exclude_train_id = $status->{train_id}; - $exclude_before = $status->{real_arrival}->epoch; + if ( $status->{real_arrival} ) { + $exclude_before = $status->{real_arrival}->epoch; + } } } @@ -2431,6 +2433,7 @@ sub startup { next; } if ( $exclude_before + and $train->departure and $train->departure->epoch < $exclude_before ) { next; -- cgit v1.2.3