Defensive coding

This commit is contained in:
Ian Renton
2025-10-20 16:09:35 +01:00
parent 15c216c5e0
commit 53977c5306

View File

@@ -56,6 +56,7 @@ class POTA(HTTPSpotProvider):
# Now we need to look up the name of that reference from the API, because the comment won't have it
park_response = self.PARK_DATA_CACHE.get(self.PARK_URL_ROOT + r.upper(), headers=HTTP_HEADERS)
park_data = park_response.json()
if park_data and "name" in park_data:
spot.sig_refs_names.append(park_data["name"])
# Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do