fix: don't return null for SharedStorage::getWrapperStorage with share recursion

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2024-03-11 17:07:49 +01:00 committed by backportbot[bot]
parent 812872ca4e
commit 459c17492b

View file

@ -138,6 +138,16 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
private function init() {
if ($this->initialized) {
if (!$this->storage) {
// marked as initialized but no storage set
// this is probably because some code path has caused recursion during the share setup
// we setup a "failed storage" so `getWrapperStorage` doesn't return null.
// If the share setup completes after this the "failed storage" will be overwritten by the correct one
$this->logger->warning('Possible share setup recursion detected');
$this->storage = new FailedStorage(['exception' => new \Exception('Possible share setup recursion detected')]);
$this->cache = new FailedCache();
$this->rootPath = '';
}
return;
}