From 29ed57b6069b0ec5ddecca395aa2b4f078207b52 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 26 Jun 2024 13:30:30 -0700 Subject: [PATCH] Update locationdata.py --- locationdata.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/locationdata.py b/locationdata.py index 9bbf638..af780ff 100644 --- a/locationdata.py +++ b/locationdata.py @@ -43,6 +43,9 @@ def get_tide(lat=0, lon=0): except (requests.exceptions.RequestException, json.JSONDecodeError): return ERROR_FETCHING_DATA + if station_id is None: + return "no tide station found" + station_id = station_json['stationList'][0]['stationId'] station_url = "https://tidesandcurrents.noaa.gov/noaatidepredictions.html?id=" + station_id