Bug fix - Fixed crash when deleting watch from UI when watch was already manually deleted from datadir (#1623)

pull/1626/head
dgtlmoon 2023-06-12 15:10:48 +02:00 zatwierdzone przez GitHub
rodzic e62eeb1c4a
commit edb5e20de6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -204,15 +204,16 @@ class ChangeDetectionStore:
# GitHub #30 also delete history records
for uuid in self.data['watching']:
path = pathlib.Path(os.path.join(self.datastore_path, uuid))
shutil.rmtree(path)
self.needs_write_urgent = True
if os.path.exists(path):
shutil.rmtree(path)
else:
path = pathlib.Path(os.path.join(self.datastore_path, uuid))
shutil.rmtree(path)
if os.path.exists(path):
shutil.rmtree(path)
del self.data['watching'][uuid]
self.needs_write_urgent = True
self.needs_write_urgent = True
# Clone a watch by UUID
def clone(self, uuid):