summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-01-26 10:48:14 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-01-26 10:48:14 +0100
commitba62df34ea8794f909407beb4b3c182994ae6031 (patch)
tree944a739bd26a1808a7193f21b219d43786134c4d /lib
parentc31254e996a0b2ddc03fdecdb27ab262b88911d1 (diff)
validate_journey: handle 0 timestamps
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 66cac2e..a62cb2e 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -2731,11 +2731,11 @@ sub startup {
}
$ref->{messages} = [ reverse @parsed_messages ];
$ref->{sched_duration}
- = $ref->{sched_arr_ts}
+ = defined $ref->{sched_arr_ts}
? $ref->{sched_arr_ts} - $ref->{sched_dep_ts}
: undef;
$ref->{rt_duration}
- = $ref->{rt_arr_ts}
+ = defined $ref->{rt_arr_ts}
? $ref->{rt_arr_ts} - $ref->{rt_dep_ts}
: undef;
my ( $km_route, $km_beeline, $skip )