Add check that prevHash is actually recorded

This commit is contained in:
Veronica Berglyd Olsen
2023-08-25 17:16:10 +02:00
parent 125d501aaf
commit 4dfc27f727
+1 -2
View File
@@ -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