Skip to content

Commit

Permalink
fix: add extra check to ensure wrapped shared storage is set
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Mar 20, 2024
1 parent d5fa2ec commit 1c23bb1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/files_sharing/lib/SharedStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,13 @@ public function getSourceStorage() {

public function getWrapperStorage() {
$this->init();

if (!$this->storage) {

Check notice

Code scanning / Psalm

DocblockTypeContradiction Note

Operand of type false is always falsy

Check notice

Code scanning / Psalm

DocblockTypeContradiction Note

Docblock-defined type OC\Files\Storage\Storage for $this->storage is never falsy
$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;
}

Expand Down

0 comments on commit 1c23bb1

Please sign in to comment.