summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pytransportapi.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pytransportapi.py b/pytransportapi.py
index 823f98c..71f3d27 100644
--- a/pytransportapi.py
+++ b/pytransportapi.py
@@ -47,7 +47,10 @@ class Location:
'100'
"""
# The id of the location
- self.loc_id = j['id']
+ try:
+ self.loc_id = j['id']
+ except KeyError:
+ self.loc_id = None
# Type of the location, can contain:
# * station: Location is a train station, bus station
# * poi: Location is a point of interest (Clock tower, China garden)