Skip to content

Commit

Permalink
Merge pull request #3187 from nextcloud/backport/3183/stable30
Browse files Browse the repository at this point in the history
  • Loading branch information
provokateurin authored Sep 9, 2024
2 parents 1842a83 + 17e996f commit 2ca5f44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Versions/VersionsBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ private function getFolderIdForFile(FileInfo $file): int {

public function getVersionFolderForFile(FileInfo $file): Folder {
$folderId = $this->getFolderIdForFile($file);
$groupfoldersVersionsFolder = $this->getVersionsFolder($folderId);

try {
$groupfoldersVersionsFolder = $this->getVersionsFolder($folderId);
/** @var Folder $versionsFolder */
return $groupfoldersVersionsFolder->get((string)$file->getId());
$versionsFolder = $groupfoldersVersionsFolder->get((string)$file->getId());
return $versionsFolder;
} catch (NotFoundException $e) {
// The folder for the file's versions might not exists if no versions has been create yet.
return $groupfoldersVersionsFolder->newFolder((string)$file->getId());
Expand Down

0 comments on commit 2ca5f44

Please sign in to comment.