diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 877de247fb128..bc098f10ee428 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -569,6 +569,13 @@ public function getSourceStorage() { public function getWrapperStorage() { $this->init(); + + 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; }