From 48c51c38deff95067872e1e256af86cfbe554541 Mon Sep 17 00:00:00 2001 From: matic_t Date: Wed, 12 Aug 2020 06:17:29 -0700 Subject: [PATCH] handling new entries --- src/model/entry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/entry.py b/src/model/entry.py index 3e0b347..5e60489 100644 --- a/src/model/entry.py +++ b/src/model/entry.py @@ -35,8 +35,8 @@ class Entry(Data): comment = entry_xml.querySelector("head comment") self.status = status.textContent if status else "" self.headword = headword.textContent if headword else "" - self.headword_type = headword.getAttribute("type") if headword.hasAttribute("type") else None - self.headword_audio = headword.getAttribute("audio") if headword.hasAttribute("audio") else None + self.headword_type = headword.getAttribute("type") if headword and headword.hasAttribute("type") else None + self.headword_audio = headword.getAttribute("audio") if headword and headword.hasAttribute("audio") else None self.grammar = grammar.textContent if grammar else "" self.comment = comment.textContent if comment else "" self.variants = [v.textContent for v in entry_xml.querySelectorAll("head variantList variant")]