diff options
author | Robin Appelman <robin@icewind.nl> | 2021-02-05 15:06:43 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-02-05 15:06:43 +0100 |
commit | b2fb4d898a552202d5afadb504704729638dc984 (patch) | |
tree | 7201cb8e1ddd390ba58a0595e8ccd59c2747fdc1 | |
parent | 137636b651168712ee88beaa8ac0483e38bf42b4 (diff) | |
download | nextcloud-server-b2fb4d898a552202d5afadb504704729638dc984.tar.gz nextcloud-server-b2fb4d898a552202d5afadb504704729638dc984.zip |
dont stop expiring versions if we cant check if the source file still exists
instead continue assuming it still exists
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | apps/files_versions/lib/Storage.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index aeb9c755bde..60a75fd484f 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -53,6 +53,7 @@ use OCA\Files_Versions\Command\Expire; use OCA\Files_Versions\Events\CreateVersionEvent; use OCA\Files_Versions\Versions\IVersionManager; use OCP\Files\NotFoundException; +use OCP\Files\StorageNotAvailableException; use OCP\IUser; use OCP\Lock\ILockingProvider; use OCP\User; @@ -724,8 +725,14 @@ class Storage { \OC_Util::setupFS($uid); - if (!Filesystem::file_exists($filename)) { - return false; + try { + if (!Filesystem::file_exists($filename)) { + return false; + } + } catch (StorageNotAvailableException $e) { + // if we can't check that the file hasn't been deleted we can only assume that it hasn't + // note that this `StorageNotAvailableException` is about the file the versions originate from, + // not the storage that the versions are stored on } if (empty($filename)) { |