From 51598047c681e8e15652e096ab6e86b14c26aa27 Mon Sep 17 00:00:00 2001 From: Robin Beer Date: Mon, 16 Dec 2024 18:29:42 +0000 Subject: [PATCH] refactor(Update to guard against missing target zoned date time when updating monitored trip): --- .../middleware/tripmonitor/jobs/CheckMonitoredTrip.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java index 7f2c56dd..80a3fbc5 100644 --- a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java +++ b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java @@ -926,7 +926,9 @@ private boolean updateMonitoredTrip() { return false; } journeyState.matchingItinerary = matchingItinerary; - journeyState.targetDate = targetZonedDateTime.format(DateTimeUtils.DEFAULT_DATE_FORMATTER); + if (targetZonedDateTime != null) { + journeyState.targetDate = targetZonedDateTime.format(DateTimeUtils.DEFAULT_DATE_FORMATTER); + } journeyState.lastCheckedEpochMillis = DateTimeUtils.currentTimeMillis(); // Update notification time if notification successfully sent. if (notificationTimestampMillis != -1) {