Skip to content

Commit 1f9f883

Browse files
committed
Fix Crash for Line Agency Lookup
1 parent 60d4b3a commit 1f9f883

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/line.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,11 @@ function cacheOperatorsAndShapes() {
359359
console.warn(error)
360360
}
361361
// query was successful
362-
lineOperators[todo[index]] = result.entries[0].agency_id._
362+
if (result.entries.length > 0) {
363+
lineOperators[todo[index]] = result.entries[0].agency_id._
364+
} else {
365+
console.warn('could not find agency for', todo[index])
366+
}
363367
getOperator(index + 1)
364368
})
365369

0 commit comments

Comments
 (0)