Guard against None returned for the top-level parent node

This commit is contained in:
Robin Dunn
2022-05-09 22:11:22 -07:00
parent fc42054af8
commit 22a3676b8e

View File

@@ -794,6 +794,8 @@ class Paragraph(Node):
section = Section(element, None, self.kind)
root = self.GetTopLevelParent()
# TODO: Why is there sometimes not a top-level parent node?
if root is not None:
root.AddSection(section)
else: