From a95dbe0fe4f811fe2b8ea314d8c7b0d2ccf8db34 Mon Sep 17 00:00:00 2001 From: bashrc Date: Mon, 18 May 2026 18:55:46 +0100 Subject: [PATCH] Ensure that latitude and longitude are floats --- maps.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/maps.py b/maps.py index 619ab1c50..04b301dc7 100644 --- a/maps.py +++ b/maps.py @@ -329,6 +329,8 @@ def get_location_from_post(post_json_object: {}) -> str: longitude = float(longitude) if is_west and longitude > 0: longitude = -longitude + if not isinstance(longitude, float): + longitude = None if property_dict['name'] == "GPSLatitude": latitude = property_dict['value'] is_south = False @@ -343,6 +345,8 @@ def get_location_from_post(post_json_object: {}) -> str: latitude = float(latitude) if is_south and latitude > 0: latitude = -latitude + if not isinstance(latitude, float): + latitude = None if latitude is not None and \ longitude is not None: locn2 = {