diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java b/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java index a99e686f2..ed8d1a58e 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java @@ -127,17 +127,19 @@ public void validate() { // Check for SS_01 (stop id appearing in multiple stop groups). // Make sure this error is only returned if we are inside the feed that is being checked. - if (seenStopIds.contains(stopId)) { - if (feedId.equals(sharedStopFeedId)) { + Stop syntheticStop = new Stop(); + syntheticStop.stop_id = stopId; + if (feedId.equals(sharedStopFeedId)) { + if (seenStopIds.contains(stopId)) { registerError(stops .stream() .filter(stop -> stop.stop_id.equals(stopId)) .findFirst() - .orElse(new Stop()), NewGTFSErrorType.MULTIPLE_SHARED_STOPS_GROUPS + .orElse(syntheticStop), NewGTFSErrorType.MULTIPLE_SHARED_STOPS_GROUPS ); + } else { + seenStopIds.add(stopId); } - } else { - seenStopIds.add(stopId); } // Check for SS_02 (multiple primary stops per stop group).