diff --git a/not1mm/lib/lookup.py b/not1mm/lib/lookup.py index 9e1d511..720d347 100644 --- a/not1mm/lib/lookup.py +++ b/not1mm/lib/lookup.py @@ -183,7 +183,7 @@ def lookup(self, call: str) -> dict: Lookup a call on QRZ """ logger.info("%s", call) - _response = None + root = {} if self.session: payload = {"s": self.session, "callsign": call} try: @@ -208,7 +208,7 @@ def lookup(self, call: str) -> dict: self.qrzurl, params=payload, timeout=3.0 ) baseroot = xmltodict.parse(query_result.text) - root = baseroot.get("QRZDatabase") + root = baseroot.get("QRZDatabase", {}) return root.get("Callsign")