Skip to content

Commit

Permalink
Merge pull request #11 from matsim-org/makeTheConverterMoreRobust
Browse files Browse the repository at this point in the history
use hasNext instead of null
  • Loading branch information
Ihab Kaddoura authored Oct 31, 2019
2 parents e89a56a + bebda84 commit 20cc145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/matsim/contrib/gtfs/GtfsConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void convertTrips(List<Trip> trips) {
int scheduleDepartures = 0;
int frequencyDepartures = 0;
for (Trip trip : trips) {
if (feed.getFrequencies(trip.trip_id).isEmpty() && feed.getOrderedStopTimesForTrip(trip.trip_id) != null) {
if (feed.getFrequencies(trip.trip_id).isEmpty() && feed.getOrderedStopTimesForTrip(trip.trip_id).iterator().hasNext()) {
StopTime firstStopTime = feed.getOrderedStopTimesForTrip(trip.trip_id).iterator().next();
Double departureTime = Time.parseTime(String.valueOf(firstStopTime.departure_time));
List<TransitRouteStop> stops = new ArrayList<>();
Expand Down

0 comments on commit 20cc145

Please sign in to comment.