Abort early if owner isn't found in Module\RemoteFollow

- Address https://github.com/friendica/friendica/issues/10473#issuecomment-899099987
This commit is contained in:
Hypolite Petovan 2021-08-17 09:38:35 -04:00
parent 6f13663c45
commit 0a592fbf34

View file

@ -32,6 +32,7 @@ use Friendica\Core\System;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Profile; use Friendica\Model\Profile;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Network\HTTPException;
use Friendica\Network\Probe; use Friendica\Network\Probe;
/** /**
@ -44,6 +45,9 @@ class RemoteFollow extends BaseModule
public static function init(array $parameters = []) public static function init(array $parameters = [])
{ {
self::$owner = User::getOwnerDataByNick($parameters['profile']); self::$owner = User::getOwnerDataByNick($parameters['profile']);
if (!self::$owner) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
DI::page()['aside'] = Widget\VCard::getHTML(self::$owner); DI::page()['aside'] = Widget\VCard::getHTML(self::$owner);
} }