summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-09-26 12:18:07 +0200
committerGitHub <noreply@github.com>2018-09-26 12:18:07 +0200
commit89fdd088c72797e5d470c2a6bb64bb440f5004b8 (patch)
tree3cb85c4d26ef5c4a89413453922bd4f2f5709899
parent2f45045c96b3d5cc552565e317263b41d04d356b (diff)
parentc526cdf8ab1273489efdf7edd44f6df4e691e8de (diff)
downloadnextcloud-server-89fdd088c72797e5d470c2a6bb64bb440f5004b8.tar.gz
nextcloud-server-89fdd088c72797e5d470c2a6bb64bb440f5004b8.zip
Merge pull request #11383 from nextcloud/fix/noid/files-unavailable-deleted-user
do not explode when getting permissions from a FailedStorage
-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 {