Merge pull request #11389 from nextcloud/backport/11383/stable14
[stable14] do not explode when getting permissions from a FailedStorage
This commit is contained in:
commit
6eab0d0ece
|
@ -32,6 +32,7 @@ use OC\Files\Cache\FailedCache;
|
||||||
use OC\Files\Cache\Wrapper\CacheJail;
|
use OC\Files\Cache\Wrapper\CacheJail;
|
||||||
use OC\Files\Storage\Wrapper\Jail;
|
use OC\Files\Storage\Wrapper\Jail;
|
||||||
use OCP\Files\Cache\ICacheEntry;
|
use OCP\Files\Cache\ICacheEntry;
|
||||||
|
use OCP\Files\StorageNotAvailableException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadata cache for shared files
|
* Metadata cache for shared files
|
||||||
|
@ -142,7 +143,14 @@ class Cache extends CacheJail {
|
||||||
} else {
|
} else {
|
||||||
$entry['path'] = $path;
|
$entry['path'] = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
$sharePermissions = $this->storage->getPermissions($entry['path']);
|
$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'])) {
|
if (isset($entry['permissions'])) {
|
||||||
$entry['permissions'] &= $sharePermissions;
|
$entry['permissions'] &= $sharePermissions;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue