Protection against strings getting into lat/lon

This commit is contained in:
Ian Renton
2026-04-02 19:28:42 +01:00
parent 14c4e6f221
commit 9814b656b2
10 changed files with 28 additions and 22 deletions

View File

@@ -337,6 +337,12 @@ class Spot:
self.dx_grid = lookup_helper.infer_grid_from_callsign_dxcc(self.dx_call)
self.dx_location_source = "DXCC"
# It looks like we can sometimes get a string into lat/lon, so reject that before we try looking anything up
if type(self.dx_latitude) == "str" or type(self.dx_longitude) == "str":
logging.warning("Received strings in lat/lon (" + str(self.dx_latitude) + ", " + str(self.dx_longitude) + "), rejecting it")
self.dx_latitude = None
self.dx_longitude = None
# CQ and ITU zone lookup, preferably from location but failing that, from callsign
if not self.dx_cq_zone:
if self.dx_latitude: