From 35e3ac61c7a8a8544337590e36e615a362850765 Mon Sep 17 00:00:00 2001
From: Markus Willman <mpewil@utu.fi>
Date: Fri, 2 Mar 2018 09:29:21 +0200
Subject: [PATCH] quick fix for potential exceptions (shape retrieval)

---
 server/app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/app.py b/server/app.py
index 05eb97b..018da01 100644
--- a/server/app.py
+++ b/server/app.py
@@ -228,7 +228,7 @@ def apiBusInfo(version, busId = None, getShape = None):
 		# route_short_name = lineref from data
 		if data  and getShape != 0:
 			# FIXME: in theory this can contain shape information for multiple trips, since route_short_name doesn't have to be and isn't unique to one trip in GTFS
-			data["shapes"] = gtfs.getTripShapes(data["lineref"], data["blockref"])
+			data["shapes"] = gtfs.getTripShapes(data.get('lineref', None), data.get('blockref', None))
 
 		if data:
 			return jsonify(data)
-- 
GitLab