diff --git a/spec_parser/mdparsing.py b/spec_parser/mdparsing.py index 4b41615..1e79fcc 100644 --- a/spec_parser/mdparsing.py +++ b/spec_parser/mdparsing.py @@ -39,10 +39,15 @@ def load(self, fpath): for p in parts[2:]: if p.strip(): m = re.fullmatch(self.RE_EXTRACT_HEADER_CONTENT, p) - header = m.group(1) - content = m.group(2).strip() - if content: - self.sections[header] = content + if m is None: + logging.error(f"File {fpath!s} may contain an empty section at `{p}'") + else: + header = m.group(1) + content = m.group(2).strip() + if content: + self.sections[header] = content + else: + logging.error(f"Content under header `{header}' in File {fpath!s} is empty.") class Section: