From: Hypolite Petovan Date: Wed, 8 Jul 2020 13:14:34 +0000 (-0400) Subject: Add error handling in Module\Xrd X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f2adec6a7f5a7f36026dea9189a545e2466e1610;p=friendica.git Add error handling in Module\Xrd - Address part of https://github.com/friendica/friendica/issues/8475#issuecomment-653912096 --- diff --git a/src/Module/Xrd.php b/src/Module/Xrd.php index 1a7b0712f5..249c143ffb 100644 --- a/src/Module/Xrd.php +++ b/src/Module/Xrd.php @@ -85,6 +85,11 @@ class Xrd extends BaseModule $owner = User::getOwnerDataById($user['uid']); + if (empty($owner)) { + DI::logger()->warning('No owner data for user id', ['uri' => $uri, 'name' => $name, 'user' => $user]); + throw new \Friendica\Network\HTTPException\NotFoundException(); + } + $alias = str_replace('/profile/', '/~', $owner['url']); $avatar = Photo::selectFirst(['type'], ['uid' => $owner['uid'], 'profile' => true]);