From e5f273ced3beac04dcbee92c53474361f2a300fe Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 16 Apr 2020 04:54:41 +0200 Subject: [PATCH] ignore missing timestamps when performing a force checkout --- lib/Travelynx.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 818205f..091a382 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -806,11 +806,10 @@ sub startup { my $tx = $db->begin; - if ( defined $train ) { - - if ( not $train->arrival ) { - die("Train has no arrival timestamp\n"); - } + if ( defined $train and not $train->arrival and not $force ) { + die("Train has no arrival timestamp\n"); + } + elsif ( defined $train and $train->arrival ) { $has_arrived = $train->arrival->epoch < $now->epoch ? 1 : 0; my $json = JSON->new;