Skip to content
Prev Previous commit
Next Next commit
fix: make root cache entry optional for groupfolder storage
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Dec 6, 2024
commit 09284947ecb74ff5a850825eeff5594e9a5dd7a1
8 changes: 6 additions & 2 deletions lib/Mount/GroupFolderStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class GroupFolderStorage extends Quota implements IConstructableStorage {
private int $folderId;
private ICacheEntry $rootEntry;
private ?ICacheEntry $rootEntry;
private IUserSession $userSession;
private ?IUser $mountOwner;
/** @var RootEntryCache|null */
Expand Down Expand Up @@ -59,7 +59,11 @@ public function getCache(string $path = '', ?IStorage $storage = null): ICache {
$storage = $this;
}

$this->cache = new RootEntryCache(parent::getCache($path, $storage), $this->rootEntry);
$cache = parent::getCache($path, $storage);
if ($this->rootEntry !== null) {
$cache = new RootEntryCache($cache, $this->rootEntry);
}
$this->cache = $cache;

return $this->cache;
}
Expand Down