From dc6df1fb7bf557fb8c902330ebd92fcc7f3e997d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Wed, 28 Aug 2024 14:56:59 +0200 Subject: [PATCH] fix convert_scans not working for some reason --- src/c3nav/routing/locator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c3nav/routing/locator.py b/src/c3nav/routing/locator.py index 3e2f3ffc..37652f90 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -140,10 +140,10 @@ class Locator: def convert_scans(self, scans_data, create_peers=False) -> ScanData: converted = [] - for scan in scans_data["wifi"]: + for scan in scans_data.get("wifi", []): converted.append(self.convert_wifi_scan(scan, create_peers=create_peers)) - for scan in scans_data["ibeacon"]: + for scan in scans_data.get("ibeacon", []): converted.append(self.convert_ibeacon_scan(scan, create_peers=create_peers)) peer_ids = reduce(operator.or_, (frozenset(values.keys()) for values in converted), frozenset())