Skip to content

Commit

Permalink
[traffic] Avoid an exception in ready_to_cross
Browse files Browse the repository at this point in the history
  • Loading branch information
minhduc0711 committed Sep 27, 2021
1 parent 7b7d898 commit c1326ba
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -1170,6 +1170,9 @@ public static Boolean readyToCross(final IScope scope,
for (OrderedBidiMap<IAgent, Double> vehicleOrderMap : RoadSkill.getVehicleOrdering(otherInRoad)) {
// The vehicle closest to the end of the road
OrderedBidiMap<Double, IAgent> distMap = vehicleOrderMap.inverseBidiMap();
if (distMap.isEmpty()) {
continue;
}
double otherDistToNode = distMap.lastKey();
IAgent otherVehicle = distMap.get(otherDistToNode);
if (otherVehicle == null || otherVehicle.dead()) {
Expand Down

0 comments on commit c1326ba

Please sign in to comment.