aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-09-26 10:43:40 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2018-09-26 13:33:59 +0200
commit5a20ac9863a4c38c371019efc57281e52f99dca6 (patch)
treea5568ae18a6942abbfc6411b0119ab72183a1c1c /apps/files_sharing
parent6c4f3ac1d68e01b9532a62ae40240ba95aee2d45 (diff)
downloadnextcloud-server-5a20ac9863a4c38c371019efc57281e52f99dca6.tar.gz
nextcloud-server-5a20ac9863a4c38c371019efc57281e52f99dca6.zip
do not explode when getting permissions from a FailedStorage
for instance if a user of an external user backend is not available currently, the whole Files UI would be frozen. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/Cache.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index f3712ead58b..bb1467ea827 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -32,6 +32,7 @@ use OC\Files\Cache\FailedCache;
use OC\Files\Cache\Wrapper\CacheJail;
use OC\Files\Storage\Wrapper\Jail;
use OCP\Files\Cache\ICacheEntry;
+use OCP\Files\StorageNotAvailableException;
/**
* Metadata cache for shared files
@@ -142,7 +143,14 @@ class Cache extends CacheJail {
} else {
$entry['path'] = $path;
}
- $sharePermissions = $this->storage->getPermissions($entry['path']);
+
+ try {
+ $sharePermissions = $this->storage->getPermissions($entry['path']);
+ } catch (StorageNotAvailableException $e) {
+ // thrown by FailedStorage e.g. when the sharer does not exist anymore
+ // (IDE may say the exception is never thrown – false negative)
+ $sharePermissions = 0;
+ }
if (isset($entry['permissions'])) {
$entry['permissions'] &= $sharePermissions;
} else {