From bf17657bb0f53005e09312a6868ae2d109836f15 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Fri, 5 Aug 2022 10:42:55 -0100 Subject: [PATCH] ignore remnants Signed-off-by: Maxence Lange --- lib/ShareByCircleProvider.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/ShareByCircleProvider.php b/lib/ShareByCircleProvider.php index be5950372..ff80f7b10 100644 --- a/lib/ShareByCircleProvider.php +++ b/lib/ShareByCircleProvider.php @@ -34,9 +34,7 @@ namespace OCA\Circles; -use OCA\Circles\Tools\Traits\TNCLogger; -use OCA\Circles\Tools\Traits\TArrayTools; -use OCA\Circles\Tools\Traits\TStringTools; +use Exception; use OC; use OCA\Circles\Exceptions\CircleNotFoundException; use OCA\Circles\Exceptions\ContactAddressBookNotFoundException; @@ -68,6 +66,9 @@ use OCA\Circles\Service\FederatedEventService; use OCA\Circles\Service\FederatedUserService; use OCA\Circles\Service\ShareWrapperService; +use OCA\Circles\Tools\Traits\TArrayTools; +use OCA\Circles\Tools\Traits\TNCLogger; +use OCA\Circles\Tools\Traits\TStringTools; use OCP\Files\Folder; use OCP\Files\InvalidPathException; use OCP\Files\IRootFolder; @@ -453,10 +454,19 @@ public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offs return []; } - $federatedUser = $this->federatedUserService->getLocalFederatedUser($userId); + $nodeId = (!is_null($node)) ? $node->getId() : 0; + + try { + $federatedUser = $this->federatedUserService->getLocalFederatedUser($userId, false); + } catch (Exception $e) { + $this->e($e, ['userId' => $userId, 'shareType' => $shareType, 'nodeId' => $nodeId]); + + return []; + } + $wrappedShares = $this->shareWrapperService->getSharesBy( $federatedUser, - (!is_null($node)) ? $node->getId() : 0, + $nodeId, $reshares, $limit, $offset,