summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index f1ae8dc..7acb2c2 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -737,6 +737,11 @@ sub startup {
my $tx = $db->begin;
if ( defined $train ) {
+
+ if ( not $train->arrival ) {
+ die("Train has no arrival timestamp\n");
+ }
+
$has_arrived = $train->arrival->epoch < $now->epoch ? 1 : 0;
my $json = JSON->new;
$db->update(