mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-05-18 06:55:38 +02:00
fix out of bounds tides
thanks @Hailo1999 for pointing this out. ref:https://github.com/SpudGunMan/meshing-around/issues/20
This commit is contained in:
@@ -45,10 +45,10 @@ def get_tide(lat=0, lon=0):
|
||||
else:
|
||||
return ERROR_FETCHING_DATA
|
||||
|
||||
station_id = station_json['stationList'][0]['stationId']
|
||||
|
||||
if station_id is None:
|
||||
if station_json['stationList'] == [] or station_json['stationList'] is None:
|
||||
return "no station found"
|
||||
|
||||
station_id = station_json['stationList'][0]['stationId']
|
||||
|
||||
except (requests.exceptions.RequestException, json.JSONDecodeError):
|
||||
return ERROR_FETCHING_DATA
|
||||
|
||||
Reference in New Issue
Block a user