From 9d9b64fc3de411913c7cc1b412e69e4c754512cc Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 3 Jan 2021 01:45:05 +0100 Subject: [PATCH] Fix a couple of broken checks --- nw/core/index.py | 3 ++- nw/gui/outlinedetails.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nw/core/index.py b/nw/core/index.py index cb0ac376..696024bf 100644 --- a/nw/core/index.py +++ b/nw/core/index.py @@ -221,6 +221,7 @@ class NWIndex(): except Exception: self.indexBroken = True + logger.debug("Index check complete") if self.indexBroken: self.clearIndex() self.theParent.makeAlert( @@ -593,7 +594,7 @@ class NWIndex(): return theRefs for refTitle in self.refIndex[tHandle]: - theTags = self.refIndex[tHandle][refTitle].get("tags", None) + theTags = self.refIndex[tHandle][refTitle].get("tags", []) for aTag in theTags: if len(aTag) == 3 and (sTitle is None or sTitle == refTitle): theRefs[aTag[1]].append(aTag[2]) diff --git a/nw/gui/outlinedetails.py b/nw/gui/outlinedetails.py index c4e54f16..2e199c9b 100644 --- a/nw/gui/outlinedetails.py +++ b/nw/gui/outlinedetails.py @@ -329,7 +329,7 @@ class GuiOutlineDetails(QScrollArea): def _formatTags(self, theRefs, theKey): """Format the tags as clickable links. """ - if theKey not in theKey: + if theKey not in theRefs: return "" refTags = [] for tTag in theRefs[theKey]: