Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: don't return null for SharedStorage::getWrapperStorage with shar…
…e recursion

Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and come-nc committed Mar 14, 2024
commit 0ace9a4efaecabefea97636c950638de98563cd5
10 changes: 10 additions & 0 deletions apps/files_sharing/lib/SharedStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ private function getSourceRootInfo() {

private function init() {
if ($this->initialized) {
if (!$this->storage) {
// marked as initialized but no storage set
// this is probably because some code path has caused recursion during the share setup
// we setup a "failed storage" so `getWrapperStorage` doesn't return null.
// If the share setup completes after this the "failed storage" will be overwritten by the correct one
$this->logger->warning('Possible share setup recursion detected');
$this->storage = new FailedStorage(['exception' => new \Exception('Possible share setup recursion detected')]);
$this->cache = new FailedCache();
$this->rootPath = '';
}
return;
}

Expand Down