From b51325a3981a6e2b6389a7eaf70d4252d3801cf4 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Mon, 9 Sep 2024 15:08:47 +0200 Subject: [PATCH] fix(versions): Handle missing versions folder Signed-off-by: provokateurin --- lib/Versions/VersionsBackend.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Versions/VersionsBackend.php b/lib/Versions/VersionsBackend.php index 19053eee0..574482cec 100644 --- a/lib/Versions/VersionsBackend.php +++ b/lib/Versions/VersionsBackend.php @@ -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());