From d0e4ec155748006d3d46a8ff0c748649d1622330 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 15 Nov 2024 15:02:13 -0300 Subject: [PATCH] fix: go ahead if the file is not found Maybe the file was deleted and at this moment we don't want to receive an error if the file was not found Signed-off-by: Vitor Mattos --- lib/Service/FileService.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) { + } } }