From: Hypolite Petovan Date: Wed, 8 Jul 2020 13:49:39 +0000 (-0400) Subject: Add error handling in Module\Profile\Status X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1f0b7690eb24781348c0baa697eae9ab0e4b92a9;p=friendica.git Add error handling in Module\Profile\Status - Address part of https://github.com/friendica/friendica/issues/8475#issuecomment-653912096 --- diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 75ba60cb26..9ab15a4e36 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -34,6 +34,7 @@ use Friendica\Model\Profile as ProfileModel; use Friendica\Model\User; use Friendica\Module\BaseProfile; use Friendica\Module\Security\Login; +use Friendica\Network\HTTPException; use Friendica\Util\DateTimeFormat; use Friendica\Util\Security; use Friendica\Util\Strings; @@ -49,6 +50,10 @@ class Status extends BaseProfile ProfileModel::load($a, $parameters['nickname']); + if (empty($a->profile)) { + throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); + } + if (!$a->profile['net-publish']) { DI::page()['htmlhead'] .= '' . "\n"; }