]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/HoverCard.php
Merge pull request #10114 from tobiasd/20210402-lng
[friendica.git] / src / Module / HoverCard.php
index f3b8248a6b198fe59e26dcaeb407effaa9207c67..f86bb959739b57db7bc2f3d18abaf54787fdbf85 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -26,7 +26,7 @@ use Friendica\Core\Session;
 use Friendica\DI;
 use Friendica\Model\Profile;
 use Friendica\Model\User;
-use Friendica\Network\HTTPException\NotFoundException;
+use Friendica\Network\HTTPException;
 
 /**
  * Loads a profile for the HoverCard view
@@ -44,11 +44,15 @@ class HoverCard extends BaseModule
                        // Show the profile hovercard
                        $nickname = $parameters['profile'];
                } else {
-                       throw new NotFoundException(DI::l10n()->t('No profile'));
+                       throw new HTTPException\NotFoundException(DI::l10n()->t('No profile'));
                }
 
                Profile::load($a, $nickname);
 
+               if (empty($a->profile)) {
+                       throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
+               }
+
                $page = DI::page();
 
                if (!empty($a->profile['page-flags']) && ($a->profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY)) {