]> git.mxchange.org Git - friendica.git/commitdiff
Add error handling in Module\Profile\Status
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 8 Jul 2020 13:49:39 +0000 (09:49 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 8 Jul 2020 13:49:39 +0000 (09:49 -0400)
- Address part of https://github.com/friendica/friendica/issues/8475#issuecomment-653912096

src/Module/Profile/Status.php

index 75ba60cb2600c758fe1b2c6a50d43e88e845dd3d..9ab15a4e36cb355bf877cf4c49fa83cdf8e47f4e 100644 (file)
@@ -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'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
                }