aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-02-06 10:57:14 +0100
committerGitHub <noreply@github.com>2021-02-06 10:57:14 +0100
commit6b1a4fa983c71c8c332b3e63d0dc395564cbdf60 (patch)
treeca71db5e5e98504e76faa865ae3b964f0848b551 /apps/files_versions
parent593b0ae9e10cc37b97aee498edb5d11f6ea036bc (diff)
parentb2fb4d898a552202d5afadb504704729638dc984 (diff)
downloadnextcloud-server-6b1a4fa983c71c8c332b3e63d0dc395564cbdf60.tar.gz
nextcloud-server-6b1a4fa983c71c8c332b3e63d0dc395564cbdf60.zip
Merge pull request #25505 from nextcloud/versions-expire-handle-unavailable
dont stop expiring versions if we cant check if the source file still exists
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/lib/Storage.php11
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)) {