summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-12-20 18:33:59 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-12-20 18:33:59 +0100
commite7f278574fa1c5f8896791c9444868b7f60760e3 (patch)
tree80a9ac43dafb56dcaad92557588b3d437849ada2 /lib/Travelynx.pm
parent11a2e94a04bf451a1b8411daa18d8f340a12a9c6 (diff)
more travel API documentation
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(