Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(versions): Handle missing versions folder #3183

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
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
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;
provokateurin marked this conversation as resolved.
Show resolved Hide resolved
} 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
Loading