Skip to content

Commit

Permalink
avoid potential NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
markusstraub committed Jan 13, 2025
1 parent 64949e6 commit cc9461a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public abstract class DrsRequest implements Request {
* leg or a drs leg accompanied by walk access and egress legs.
*
* @param drsNetwork must only consist of links accessible to the drsDriver mode
* @return null in case no useful request can be created
*/
public static DrsRequest create(Id<Request> id, RoutingModule driverRouter, Network drsNetwork, Person person,
Trip trip) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public void collectRequests() {

Id<Request> id = Id.create(++requestId, Request.class);
DrsRequest request = DrsRequest.create(id, driverRouter, drsNetwork, person, trip);
if (request == null) {
continue;
}

double distance = request.getNetworkRouteDistance();
if (request instanceof DrsDriverRequest) {
Expand Down

0 comments on commit cc9461a

Please sign in to comment.