From 1e7d329962804b75a81cd63d91a89178d6fe9a39 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 28 Apr 2022 19:04:21 +0200 Subject: [PATCH] Force conistency of ROOT item settings --- novelwriter/core/item.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/novelwriter/core/item.py b/novelwriter/core/item.py index e23b4fb9..54913b4a 100644 --- a/novelwriter/core/item.py +++ b/novelwriter/core/item.py @@ -239,6 +239,11 @@ class NWItem(): # version of novelWriter that doesn't know the tag logger.error("Unknown tag '%s'", xValue.tag) + # Make some checks to ensure consistency + if self._type == nwItemType.ROOT: + self._root = self._handle # Root items are their own ancestor + self._parent = None # Root items cannot have a parent + return True @staticmethod