From 8c4e5b99fe1f80077e4ed3691b9b944a753638ea Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 20 Mar 2022 15:22:09 +0100 Subject: [PATCH] Only compute shasum of file if it exists (#1023) --- novelwriter/core/document.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/novelwriter/core/document.py b/novelwriter/core/document.py index 71916af8..2334c77c 100644 --- a/novelwriter/core/document.py +++ b/novelwriter/core/document.py @@ -89,9 +89,10 @@ class NWDoc(): theText = "" self._docMeta = {} - self._prevHash = sha256sum(docPath) + self._prevHash = None if os.path.isfile(docPath): + self._prevHash = sha256sum(docPath) try: with open(docPath, mode="r", encoding="utf-8") as inFile: # Check the first <= 10 lines for metadata