fix: add extra check to ensure wrapped shared storage is set

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2024-03-20 14:34:59 +01:00 committed by backportbot[bot]
parent e2eb5eec3c
commit 93dc9fca32

View file

@ -529,6 +529,16 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
public function getWrapperStorage() {
$this->init();
/**
* @psalm-suppress DocblockTypeContradiction
*/
if (!$this->storage) {
$message = "no storage set after init for share " . $this->getShareId();
$this->logger->error($message);
$this->storage = new FailedStorage(['exception' => new \Exception($message)]);
}
return $this->storage;
}