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(); } /**