From 4dfc27f727b10442a8ffccc9bb66a57c31d2bd7e Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Fri, 25 Aug 2023 17:16:10 +0200 Subject: [PATCH] Add check that prevHash is actually recorded --- novelwriter/core/document.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/novelwriter/core/document.py b/novelwriter/core/document.py index de81e7ef..769892a7 100644 --- a/novelwriter/core/document.py +++ b/novelwriter/core/document.py @@ -183,8 +183,7 @@ class NWDocument: # Re-read the document on disk to check if it has changed prevHash = self._lastHash self.readDocument() - print(f"'{self._lastHash}', '{prevHash}'") - if self._lastHash != prevHash and not forceWrite: + if prevHash and self._lastHash != prevHash and not forceWrite: logger.error("File has been altered on disk since opened") self._hashError = True return False