Skip to content

Commit

Permalink
Merge pull request #5017 from nextcloud/bugfix/5001
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Nov 21, 2023
2 parents e860238 + 5173c01 commit 3ef86f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Service/DocumentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,11 @@ public function getAll(): array {
*/
public function getFileForSession(Session $session, ?string $shareToken = null): File {
if (!$session->isGuest()) {
return $this->getFileById($session->getDocumentId(), $session->getUserId());
try {
return $this->getFileById($session->getDocumentId(), $session->getUserId());
} catch (NotFoundException) {
// We may still have a user session but on a public share link so move on
}
}

if ($shareToken === null) {
Expand Down

0 comments on commit 3ef86f3

Please sign in to comment.