]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Notifications/Ping.php
Merge pull request #12364 from MrPetovan/bug/warnings
[friendica.git] / src / Module / Notifications / Ping.php
index 76cdd9f77055ce967968eda5d712fd6e07e3d651..df75c047afdd8b8c25d8f135743710db1e930786 100644 (file)
@@ -48,6 +48,7 @@ use Friendica\Navigation\Notifications\Factory;
 use Friendica\Navigation\Notifications\Repository;
 use Friendica\Navigation\Notifications\ValueObject;
 use Friendica\Navigation\SystemMessages;
+use Friendica\Network\HTTPException;
 use Friendica\Protocol\Activity;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Profiler;
@@ -229,7 +230,11 @@ class Ping extends BaseModule
 
                        // merge all notification types in one array
                        foreach ($intros as $intro) {
-                               $navNotifications[] = $this->formattedNavNotification->createFromIntro($intro);
+                               try {
+                                       $navNotifications[] = $this->formattedNavNotification->createFromIntro($intro);
+                               } catch (HTTPException\NotFoundException $e) {
+                                       $this->introductionRepo->delete($intro);
+                               }
                        }
 
                        if (count($registrations) <= 1 || $this->pconfig->get($this->session->getLocalUserId(), 'system', 'detailed_notif')) {
@@ -242,7 +247,7 @@ class Ping extends BaseModule
                                                new Uri($this->baseUrl->get(true) . '/moderation/users/pending')
                                        );
                                }
-                       } elseif (count($registrations) > 1) {
+                       } else {
                                $navNotifications[] = $this->formattedNavNotification->createFromParams(
                                        $registrations[0]['name'],
                                        $registrations[0]['url'],