diff --git a/server/app.py b/server/app.py
index 05eb97b80973ce5d3766d388508ac008f5301750..018da01e37fdb50b609b92ae4a680d20ab1d46ad 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)