Skip to content

Commit

Permalink
fix(versions): Handle missing versions folder
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin authored and backportbot[bot] committed Sep 9, 2024
1 parent c5449f6 commit b51325a
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 @@ -82,11 +82,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 b51325a

Please sign in to comment.