From c61adfcbe67e1dcf3326796153fb373c74639e79 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 6657b2907..a8004ea66 100644 --- a/lib/Versions/VersionsBackend.php +++ b/lib/Versions/VersionsBackend.php @@ -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());