Skip to content

Commit

Permalink
refactor(UsRide...Message): check for null journey/trip.
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Dec 4, 2024
1 parent d9cce93 commit dcde571
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit dcde571

Please sign in to comment.