Skip to content

Commit

Permalink
Merge pull request #65 from nextcloud/fix/noid/ignore-exception-on-un…
Browse files Browse the repository at this point in the history
…known-entity

ignore exception on unknown entity
  • Loading branch information
ArtificialOwl authored Oct 8, 2022
2 parents 7a4ee5c + 809a625 commit 600e862
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ private function generateSingleId(CalendarShare $share): void {
}


/**
* @param string $principalUri
*
* @return FederatedUser
* @throws Exception
*/
private function extractEntity(string $principalUri): FederatedUser {
[$shareType, $recipient] = explode('/', substr($principalUri, 11), 2);

Expand Down
5 changes: 4 additions & 1 deletion lib/RelatedResourceProviders/DeckRelatedResourceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ private function convertToRelatedResource(DeckShare $share): IRelatedResource {
*/
private function assignEntities(array $shares): void {
foreach ($shares as $share) {
$this->assignEntity($share);
try {
$this->assignEntity($share);
} catch (Exception $e) {
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions lib/RelatedResourceProviders/TalkRelatedResourceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ public function getRelatedToEntity(FederatedUser $entity): array {
switch ($entity->getBasedOn()->getSource()) {
case Member::TYPE_USER:
$shares = $this->talkRoomRequest->getSharesToUser($entity->getUserId());

return [];
break;

case Member::TYPE_GROUP:
$shares = $this->talkRoomRequest->getSharesToGroup($entity->getUserId());
Expand Down Expand Up @@ -168,7 +167,10 @@ private function convertToRelatedResource(TalkRoom $share): IRelatedResource {
*/
private function assignEntities(array $shares): void {
foreach ($shares as $share) {
$this->assignEntity($share);
try {
$this->assignEntity($share);
} catch (Exception $e) {
}
}
}

Expand Down

0 comments on commit 600e862

Please sign in to comment.