Add a bunch of None checks, even if many may be redundant

This commit is contained in:
Veronica Berglyd Olsen
2022-10-20 00:21:51 +02:00
parent cfe11f7b54
commit 815c0f1125
9 changed files with 45 additions and 33 deletions
+3 -1
View File
@@ -156,7 +156,9 @@ class GuiWordList(QDialog):
try:
with open(tmpFile, mode="w", encoding="utf-8") as outFile:
for i in range(self.listBox.count()):
outFile.write(self.listBox.item(i).text() + "\n")
item = self.listBox.item(i)
if item is not None:
outFile.write(item.text() + "\n")
except Exception:
logger.error("Could not save new word list")