From 1f0b7690eb24781348c0baa697eae9ab0e4b92a9 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 8 Jul 2020 09:49:39 -0400 Subject: [PATCH] Add error handling in Module\Profile\Status - Address part of https://github.com/friendica/friendica/issues/8475#issuecomment-653912096 --- src/Module/Profile/Status.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 75ba60cb2..9ab15a4e3 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"; }