diff --git a/contribs/drt/src/main/java/org/matsim/contrib/drt/prebooking/PrebookingStopActivity.java b/contribs/drt/src/main/java/org/matsim/contrib/drt/prebooking/PrebookingStopActivity.java index 3c04ba985a3..e55af9e76a5 100644 --- a/contribs/drt/src/main/java/org/matsim/contrib/drt/prebooking/PrebookingStopActivity.java +++ b/contribs/drt/src/main/java/org/matsim/contrib/drt/prebooking/PrebookingStopActivity.java @@ -206,8 +206,10 @@ protected void simStep(double now) { @Override public void notifyPassengersAreReadyForDeparture(List passengers, double now) { var request = getRequestForPassengers(passengers.stream().map(Identifiable::getId).toList()); - queuePickup(request, now); - expectedPickups.remove(request.getId()); + if(expectedPickups.containsKey(request.getId())) { + queuePickup(request, now); + expectedPickups.remove(request.getId()); + } } private AcceptedDrtRequest getRequestForPassengers(List> passengerIds) {