diff --git a/modules/locationdata.py b/modules/locationdata.py index b7ec979..1bb50ba 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -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: return "no station found" - - station_id = station_json['stationList'][0]['stationId'] except (requests.exceptions.RequestException, json.JSONDecodeError): return ERROR_FETCHING_DATA