From 1f9f883df7392cf02bd85269402e48ebe2922a7f Mon Sep 17 00:00:00 2001 From: Jono Cooper Date: Thu, 30 Mar 2017 01:19:28 +1300 Subject: [PATCH] Fix Crash for Line Agency Lookup --- server/line.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/line.js b/server/line.js index 922d336d..86911925 100644 --- a/server/line.js +++ b/server/line.js @@ -359,7 +359,11 @@ function cacheOperatorsAndShapes() { console.warn(error) } // query was successful - lineOperators[todo[index]] = result.entries[0].agency_id._ + if (result.entries.length > 0) { + lineOperators[todo[index]] = result.entries[0].agency_id._ + } else { + console.warn('could not find agency for', todo[index]) + } getOperator(index + 1) })