aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-03-20 14:34:59 +0100
committerRobin Appelman <robin@icewind.nl>2024-03-20 14:48:55 +0100
commit85b5dd0a4325672c8dcef82df04a2c0306a4fb5b (patch)
tree9b42b2a78b6d2360e768895012b83c46ff789346 /apps
parentd5fa2ec7c3dc194d2e4f8684b781252e76ad43e0 (diff)
downloadnextcloud-server-85b5dd0a4325672c8dcef82df04a2c0306a4fb5b.tar.gz
nextcloud-server-85b5dd0a4325672c8dcef82df04a2c0306a4fb5b.zip
fix: add extra check to ensure wrapped shared storage is set
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/SharedStorage.php10
1 files changed, 10 insertions, 0 deletions
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;
}