Skip to content

Commit

Permalink
fix: go ahead if the file is not found
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vitormattos authored and backportbot-libresign[bot] committed Nov 15, 2024
1 parent ecc0d1b commit d0e4ec1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Service/FileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
}
}
}

0 comments on commit d0e4ec1

Please sign in to comment.