From b9f8ccd82af56a50f2617048fb3c43d824521f54 Mon Sep 17 00:00:00 2001
From: Derf Null <derf@finalrewind.org>
Date: Thu, 11 May 2023 18:32:27 +0200
Subject: [PATCH] ajax route: handle missing schedule data

---
 lib/Travelynx.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index ca80352a..7ec1e5ca 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -1332,10 +1332,10 @@ sub startup {
 
 			for my $station ( @{ $journey->{route_after} } ) {
 				my $station_desc = $station->[0];
-				if ( $station->[2]{rt_arr} ) {
+				if ( $station->[2]{sched_arr} and $station->[2]{rt_arr} ) {
 					$station_desc .= $station->[2]{sched_arr}->strftime(';%s');
 					$station_desc .= $station->[2]{rt_arr}->strftime(';%s');
-					if ( $station->[2]{rt_dep} ) {
+					if ( $station->[2]{sched_dep} and $station->[2]{rt_dep} ) {
 						$station_desc
 						  .= $station->[2]{sched_dep}->strftime(';%s');
 						$station_desc .= $station->[2]{rt_dep}->strftime(';%s');
-- 
GitLab