MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
278 stars 100 forks source link

[BUG] Validator unable to execute when agency_ID is missing. #396

Closed mcplanner-zz closed 3 years ago

mcplanner-zz commented 3 years ago

Describe the bug The validator was unable to process a feed and gave an error.

To Reproduce Run the validator on the following dataset: http://transitfeeds.com/p/long-beach-transit/704/latest/download

Expected behavior No notice should be generated in this case.

Witnessed behavior Upon running the validator, I received this message before the operation ended.

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.isBlank()" because "this.agencyId" is null
    at org.mobilitydata.gtfsvalidator.domain.entity.gtfs.routes.Route$RouteBuilder.build(Route.java:281)
    at org.mobilitydata.gtfsvalidator.usecase.ProcessParsedRoute.execute(ProcessParsedRoute.java:80)
    at org.mobilitydata.gtfsvalidator.Main.lambda$main$0(Main.java:113)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.mobilitydata.gtfsvalidator.Main.main(Main.java:94)

Environment used

Additional context The agency_ID field only appears in the agency.txt file.

ghost commented 3 years ago

Duplicate of #378

Fix already available in the latest snapshot version, see https://github.com/MobilityData/gtfs-validator/actions