From 85b5dd0a4325672c8dcef82df04a2c0306a4fb5b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 20 Mar 2024 14:34:59 +0100 Subject: [PATCH] fix: add extra check to ensure wrapped shared storage is set Signed-off-by: Robin Appelman --- apps/files_sharing/lib/SharedStorage.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 877de247fb1..d5c264def3b 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -569,6 +569,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; } -- 2.39.5