Merge pull request #1658 from nextcloud/fix/noid/stop-spam-log

catch missing actor
pull/1662/head
Maxence Lange 2023-03-15 15:24:06 -01:00 zatwierdzone przez GitHub
commit 3fc14ced4f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -34,6 +34,7 @@ use Exception;
use OCA\Social\AP;
use OCA\Social\Db\ActorsRequest;
use OCA\Social\Db\CacheActorsRequest;
use OCA\Social\Exceptions\ActorDoesNotExistException;
use OCA\Social\Exceptions\CacheActorDoesNotExistException;
use OCA\Social\Exceptions\InvalidOriginException;
use OCA\Social\Exceptions\InvalidResourceException;
@ -177,6 +178,7 @@ class CacheActorService {
* @return Person
* @throws CacheActorDoesNotExistException
* @throws SocialAppConfigException
* @throws ActorDoesNotExistException
*/
public function getFromLocalAccount(string $account): Person {
$instance = '';

Wyświetl plik

@ -26,6 +26,7 @@ declare(strict_types=1);
namespace OCA\Social\WellKnown;
use OCA\Social\Db\CacheActorsRequest;
use OCA\Social\Exceptions\ActorDoesNotExistException;
use OCA\Social\Exceptions\CacheActorDoesNotExistException;
use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Exceptions\UnauthorizedFediverseException;
@ -109,7 +110,7 @@ class WebfingerHandler implements IHandler {
$actor = null;
try {
$actor = $this->cacheActorService->getFromLocalAccount($subject);
} catch (SocialAppConfigException $e) {
} catch (ActorDoesNotExistException | SocialAppConfigException $e) {
return null;
} catch (CacheActorDoesNotExistException $e) {
}