Skip to content

Commit

Permalink
Update UAMXMLReader.java
Browse files Browse the repository at this point in the history
  • Loading branch information
RRothfeld committed Oct 30, 2019
1 parent 38f8b83 commit 5f7c118
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ public void startTag(String name, Attributes atts, Stack<String> context) {

this.mapVehicleVerticalSpeeds.put(id.toString(), verticalSpeed);
this.mapVehicleHorizontalSpeeds.put(id.toString(), horizontalSpeed);
UAMVehicle vehicle = new UAMVehicle(id, stationid, this.stations.get(stationid).getLocationLink(), capacity,
starttime, endtime, vehicleTypes.get(vehicleTypeId));
vehicles.put(id, vehicle);

try {
UAMVehicle vehicle = new UAMVehicle(id, stationid, this.stations.get(stationid).getLocationLink(), capacity,
starttime, endtime, vehicleTypes.get(vehicleTypeId));
vehicles.put(id, vehicle);
} catch (NullPointerException e) {
Log.warn("UAM vehicle " + id + " could not be added. Check correct initial station or vehicle type.");
}
} else {
Log.warn("There was an error parsing the UAM xml-file. Non vehicle/station element found.");
}
Expand Down

0 comments on commit 5f7c118

Please sign in to comment.