зеркало из https://github.com/nextcloud/text.git
Catch the exception when a user no longer exists
Else this could result in a lot of log spam. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Родитель
8b87d83cbe
Коммит
74117d916e
|
@ -343,7 +343,14 @@ class DocumentService {
|
|||
* @throws NotFoundException
|
||||
*/
|
||||
public function getFileById($fileId, $userId = null): Node {
|
||||
$files = $this->rootFolder->getUserFolder($this->userId ?? $userId)->getById($fileId);
|
||||
try {
|
||||
$userFolder = $this->rootFolder->getUserFolder($this->userId ?? $userId);
|
||||
} catch (\OC\User\NoUserException $e) {
|
||||
// It is a bit hacky to depend on internal exceptions here. But it is the best we can do for now
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
$files = $userFolder->getById($fileId);
|
||||
if (count($files) === 0) {
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче