mirror of https://gitlab.com/openlp/openlp.git
When a permission error is raised during generation of the sha256 hash when deleting a presentation from the controller don't crash but continue.
This commit is contained in:
parent
2fb1085a00
commit
bbcea34498
|
@ -156,7 +156,7 @@ class PresentationDocument(object):
|
|||
else:
|
||||
self._sha256_file_hash = sha256_file_hash(self.file_path)
|
||||
# If the sha256_file_hash() function encounters an error, it will return None, so use the
|
||||
# filename as the thumbnail folder if the result is None (or falsey)
|
||||
# filename as the thumbnail folder if the result is None (or falsey).
|
||||
folder = self._sha256_file_hash or self.file_path.name
|
||||
else:
|
||||
folder = self.file_path.name
|
||||
|
@ -178,7 +178,9 @@ class PresentationDocument(object):
|
|||
folder = self._sha256_file_hash
|
||||
else:
|
||||
self._sha256_file_hash = sha256_file_hash(self.file_path)
|
||||
folder = self._sha256_file_hash
|
||||
# If the sha256_file_hash() function encounters an error, it will return None, so use the
|
||||
# filename as the temp folder if the result is None (or falsey).
|
||||
folder = self._sha256_file_hash or self.file_path.name
|
||||
else:
|
||||
folder = self.file_path.name
|
||||
return Path(self.controller.temp_folder, folder)
|
||||
|
|
Loading…
Reference in New Issue