diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php index 83a7cf4412..21f47e748a 100644 --- a/lib/Service/FileService.php +++ b/lib/Service/FileService.php @@ -39,6 +39,7 @@ use OCP\AppFramework\Services\IAppConfig; use OCP\Files\IMimeTypeDetector; use OCP\Files\IRootFolder; +use OCP\Files\NotFoundException; use OCP\Http\Client\IClientService; use OCP\IDateTimeFormatter; use OCP\IL10N; @@ -620,7 +621,10 @@ public function delete(int $fileId): void { $signedNextcloudFile = $this->folderService->getFileById($file->getSignedNodeId()); $signedNextcloudFile->delete(); } - $nextcloudFile = $this->folderService->getFileById($fileId); - $nextcloudFile->delete(); + try { + $nextcloudFile = $this->folderService->getFileById($fileId); + $nextcloudFile->delete(); + } catch (NotFoundException $e) { + } } }