From dcde5713a9971e71f9bb68c248aa1a26bc1e82cf Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:00:18 -0500 Subject: [PATCH] refactor(UsRide...Message): check for null journey/trip. --- .../busnotifiers/UsRideGwinnettBusOpNotificationMessage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/opentripplanner/middleware/triptracker/interactions/busnotifiers/UsRideGwinnettBusOpNotificationMessage.java b/src/main/java/org/opentripplanner/middleware/triptracker/interactions/busnotifiers/UsRideGwinnettBusOpNotificationMessage.java index bf93ae527..cd08d2016 100644 --- a/src/main/java/org/opentripplanner/middleware/triptracker/interactions/busnotifiers/UsRideGwinnettBusOpNotificationMessage.java +++ b/src/main/java/org/opentripplanner/middleware/triptracker/interactions/busnotifiers/UsRideGwinnettBusOpNotificationMessage.java @@ -1,5 +1,6 @@ package org.opentripplanner.middleware.triptracker.interactions.busnotifiers; +import org.opentripplanner.middleware.models.TrackedJourney; import org.opentripplanner.middleware.triptracker.TravelerPosition; import java.time.Instant; @@ -96,7 +97,8 @@ public UsRideGwinnettBusOpNotificationMessage(Instant currentTime, TravelerPosit // 1 = Notify, 0 = Cancel. this.msg_type = 1; this.mobility_codes = getMobilityCode(travelerPosition.mobilityMode); - this.trusted_companion = travelerPosition.trackedJourney.trip.hasConfirmedCompanion(); + TrackedJourney journey = travelerPosition.trackedJourney; + this.trusted_companion = journey != null && journey.trip != null && journey.trip.hasConfirmedCompanion(); } /**