Skip to content

Commit 048df20

Browse files
committed
routes: with exactly 1 agency, fix handling of missing agency_id 🐛
1 parent 2e514a7 commit 048df20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ const importData = async (db, pathToRoutes, opt, workingState) => {
244244
// The GTFS spec allows routes.agency_id to be empty/null if there is exactly one agency in the feed.
245245
// It seems that GTFS has allowed this at least since 2016:
246246
// https://github.com/google/transit/blame/217e9bf/gtfs/spec/en/reference.md#L544-L554
247-
const exactly1Agency = workingState.nrOfRowsByName.get('agency') === 1
247+
const exactly1Agency = workingState.nrOfRowsByName.get('agency') === 1n
248248
// todo: throw special error indicating an error in the input data? does the foreign key constraint achieve this implicitly? old code:
249249
// throw new DataError(
250250
// 'routes',

0 commit comments

Comments
 (0)