summaryrefslogtreecommitdiff
path: root/templates/_train_details.html.ep
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-02-05 12:38:32 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-02-05 12:38:32 +0100
commit6b0dbedeece748c31dff7b190e75ebab66603a74 (patch)
treea4210512328edd569260574d78b363c39bf43014 /templates/_train_details.html.ep
parente9be0151681f45ab95b2c4ba0981ac017afde562 (diff)
train details: fix uninitialized value issues
Diffstat (limited to 'templates/_train_details.html.ep')
-rw-r--r--templates/_train_details.html.ep14
1 files changed, 5 insertions, 9 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep
index 0240a18..05e3483 100644
--- a/templates/_train_details.html.ep
+++ b/templates/_train_details.html.ep
@@ -52,7 +52,7 @@
% }
% elsif ($departure->{arrival}) {
% if ($departure->{arrival} ne $departure->{sched_arrival}) {
- % if ($departure->{delay} < 0) {
+ % if (($departure->{delay} // 0) < 0) {
An: <span class="undelay"><%= $departure->{arrival} %></span>
% }
% else {
@@ -242,15 +242,11 @@
% }
% if (stash('station_name')) {
<li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %> <%= $departure->{isPast} ? 'past-stop' : 'future-stop' %>"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %>
-% if ($departure->{sched_departure}) {
-% if ($departure->{departure} ne $departure->{sched_departure}) {
- (heute <%= $departure->{departure} %>)
-% }
+% if ($departure->{departure} and $departure->{sched_departure} and $departure->{departure} ne $departure->{sched_departure}) {
+ (heute <%= $departure->{departure} %>)
% }
-% elsif ($departure->{arrival}) {
-% if ($departure->{arrival} ne $departure->{sched_arrival}) {
- (heute <%= $departure->{arrival} %>)
-% }
+% elsif ($departure->{arrival} and $departure->{sched_arrival} and $departure->{arrival} ne $departure->{sched_arrival}) {
+ (heute <%= $departure->{arrival} %>)
% }
% if ($departure->{missing_realtime} or $departure->{no_realtime_yet}) {
<i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i>