Skip to content

Commit

Permalink
do not crash on mount issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtificialOwl authored and backportbot[bot] committed May 15, 2021
1 parent 1666c62 commit 0706881
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/Service/FilesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,14 @@ private function generateFilesDocumentFromFile(string $viewerId, Node $file): Fi
$ownerId = '';
}

$document->setType($file->getType())
->setOwnerId($ownerId)
->setPath($this->getPathFromViewerId($file->getId(), $viewerId))
->setViewerId($viewerId);
try {
$document->setType($file->getType())
->setOwnerId($ownerId)
->setPath($this->getPathFromViewerId($file->getId(), $viewerId))
->setViewerId($viewerId);
} catch (Throwable $t) {
throw new FileIsNotIndexableException();
}

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

} catch (Exception $e) {
} catch (Throwable $e) {
$this->miscService->log(
'Issue while getting information on documentId:' . $document->getId(), 0
);
Expand Down

0 comments on commit 0706881

Please sign in to comment.