diff --git a/lib/Service/FolderService.php b/lib/Service/FolderService.php index 07f04bb9b9..5bf333163f 100644 --- a/lib/Service/FolderService.php +++ b/lib/Service/FolderService.php @@ -21,6 +21,7 @@ use OCP\IGroupManager; use OCP\IL10N; use OCP\IUser; +use OCP\Lock\LockedException; class FolderService { protected IAppData $appData; @@ -50,11 +51,19 @@ public function getUserId(): ?string { * @psalm-suppress MixedReturnStatement * @throws NotFoundException * @throws NotPermittedException + * @throws LockedException */ public function getFolder(): Folder { $path = $this->getLibreSignDefaultPath(); $containerFolder = $this->getContainerFolder(); - return $containerFolder->newFolder($path); + try { + /** @var Folder $folder */ + $folder = $containerFolder->get($path); + } catch (NotFoundException) { + /** @var Folder $folder */ + $folder = $containerFolder->newFolder($path); + } + return $folder; } /**