mirror of
https://github.com/friendica/friendica
synced 2025-04-28 13:04:23 +02:00
Add Exception for empty User::getOwnerDataById(0 return case in Protocol\ActivityPub\Transmitter::getProfile()
- Address https://github.com/friendica/friendica/issues/10473#issuecomment-882781552 - Add try-catch blocks to all references of Protocol\ActivityPub\Transmitter::getProfile()
This commit is contained in:
parent
71a0c52dc3
commit
dfb043ce60
5 changed files with 53 additions and 26 deletions
|
@ -28,6 +28,7 @@ use Friendica\Core\System;
|
|||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBStructure;
|
||||
use Friendica\DI;
|
||||
use Friendica\Network\HTTPException;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Protocol\ActivityNamespace;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
|
@ -178,8 +179,12 @@ class APContact
|
|||
}
|
||||
|
||||
if (Network::isLocalLink($url) && ($local_uid = User::getIdForURL($url))) {
|
||||
$data = Transmitter::getProfile($local_uid);
|
||||
$local_owner = User::getOwnerDataById($local_uid);
|
||||
try {
|
||||
$data = Transmitter::getProfile($local_uid);
|
||||
$local_owner = User::getOwnerDataById($local_uid);
|
||||
} catch(HTTPException\NotFoundException $e) {
|
||||
$data = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue