Skip to content

Commit 94ed649

Browse files
authored
Merge pull request #481 from mbridak/478-crashes-save-qso
Add error handling for data parsing in MainWindow class
2 parents dc316db + 3c00f46 commit 94ed649

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

not1mm/__main__.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,12 +1420,15 @@ def fldigi_qso(self, result: str) -> None:
14201420
if result and result != "NONE":
14211421
datadict = {}
14221422
splitdata = result.upper().strip().split("<")
1423-
for data in splitdata:
1424-
if data:
1425-
tag = data.split(":")
1426-
if tag == ["EOR>"]:
1427-
break
1428-
datadict[tag[0]] = tag[1].split(">")[1].strip()
1423+
try:
1424+
for data in splitdata:
1425+
if data:
1426+
tag = data.split(":")
1427+
if tag == ["EOR>"]:
1428+
break
1429+
datadict[tag[0]] = tag[1].split(">")[1].strip()
1430+
except IndexError:
1431+
logger.debug(f"Parse error: {result=} {data=} {tag=}")
14291432
logger.debug(f"{datadict=}")
14301433
if hasattr(self.contest, "ft8_handler"):
14311434
self.contest.set_self(self)

0 commit comments

Comments
 (0)