Skip to content

Commit

Permalink
Merge pull request #3183 from nextcloud/fix/versions/missing-folder
Browse files Browse the repository at this point in the history
  • Loading branch information
provokateurin authored Sep 9, 2024
2 parents b8b4258 + c61adfc commit cca16eb
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 cca16eb

Please sign in to comment.