From f8150ccc698c7c014d33f3c9455c235bbb80ed3d Mon Sep 17 00:00:00 2001 From: "papko@thinkpad" Date: Mon, 2 Dec 2024 21:32:35 +0200 Subject: [PATCH] coords extractor bugfix --- app/gtw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/gtw.py b/app/gtw.py index 9fc0f0a..37a7330 100644 --- a/app/gtw.py +++ b/app/gtw.py @@ -377,8 +377,8 @@ def extract_coordinates_with_regex(url): # user browsed after he chosed the destination. # Lets ensure we will not try to parse it. # Same for /dir/ locations - it is google maps directions (route). - if "/place/" in url or "/dir/": - logger.debug("fastrrack: it is a 'places' link, parsing skipped") + if url and ("/place/" in url or "/dir/" in url): + logger.debug("fastrrack: it is a 'places' or 'dir' link, parsing skipped") return None # Regex pattern to match latitude and longitude pairs pattern = r"(-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?)"