Only compute shasum of file if it exists (#1023)

This commit is contained in:
Veronica Berglyd Olsen
2022-03-20 15:22:09 +01:00
committed by GitHub
parent 16ce55ba60
commit 8c4e5b99fe
+2 -1
View File
@@ -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