Skip to content

Commit 0706881

Browse files
ArtificialOwlbackportbot[bot]
authored andcommitted
do not crash on mount issue
1 parent 1666c62 commit 0706881

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/Service/FilesService.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,14 @@ private function generateFilesDocumentFromFile(string $viewerId, Node $file): Fi
412412
$ownerId = '';
413413
}
414414

415-
$document->setType($file->getType())
416-
->setOwnerId($ownerId)
417-
->setPath($this->getPathFromViewerId($file->getId(), $viewerId))
418-
->setViewerId($viewerId);
415+
try {
416+
$document->setType($file->getType())
417+
->setOwnerId($ownerId)
418+
->setPath($this->getPathFromViewerId($file->getId(), $viewerId))
419+
->setViewerId($viewerId);
420+
} catch (Throwable $t) {
421+
throw new FileIsNotIndexableException();
422+
}
419423

420424
if ($file->getMimetype() !== null) {
421425
$document->setMimetype($file->getMimetype());
@@ -779,7 +783,7 @@ private function updateShareNames(FilesDocument $document, Node $file): array {
779783
$shareNames[$this->miscService->secureUsername($username)] =
780784
(!is_string($path)) ? $path = '' : $path;
781785

782-
} catch (Exception $e) {
786+
} catch (Throwable $e) {
783787
$this->miscService->log(
784788
'Issue while getting information on documentId:' . $document->getId(), 0
785789
);

0 commit comments

Comments
 (0)