Skip to content

Commit

Permalink
@mbridak Provided initial condition for root.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbridak committed Nov 5, 2024
1 parent 1d648a3 commit 159e23d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions not1mm/lib/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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")


Expand Down

0 comments on commit 159e23d

Please sign in to comment.