diff --git a/extract_romset.py b/extract_romset.py index eba5ee8..2a79663 100755 --- a/extract_romset.py +++ b/extract_romset.py @@ -17,5 +17,6 @@ for game in root.findall("game"): textFile = os.path.splitext(f"{romName}")[0] + ".txt" os.makedirs("text", exist_ok=True) - with open(f"text/{textFile}", "w", encoding="utf-8") as f: - f.write(game.find("description").text) + if game.find("description") is not None: + with open(f"text/{textFile}", "w", encoding="utf-8") as f: + f.write(game.find("description").text)