From 097e3d6dcc12ad5175f0e3d4a66032c6d27b4ce3 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 20 Oct 2020 15:15:33 +0000 Subject: [PATCH] Fix Fatal error: Uncaught TypeError: Argument 1 passed to Friendica\Model\Contact::getByURL() must be of the type string, null given --- src/Factory/Notification/Introduction.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Factory/Notification/Introduction.php b/src/Factory/Notification/Introduction.php index efee886f91..8097da4712 100644 --- a/src/Factory/Notification/Introduction.php +++ b/src/Factory/Notification/Introduction.php @@ -115,10 +115,17 @@ class Introduction extends BaseFactory ); while ($notification = $this->dba->fetch($stmtNotifications)) { - // There are two kind of introduction. Contacts suggested by other contacts and normal connection requests. + if (empty($notification['url'])) { + continue; + } + + // There are two kind of introduction. Contacts suggested by other contacts and normal connection requests. // We have to distinguish between these two because they use different data. // Contact suggestions if ($notification['fid'] ?? '') { + if (empty($notification['furl'])) { + continue; + } $return_addr = bin2hex($this->nick . '@' . $this->baseUrl->getHostName() . (($this->baseUrl->getURLPath()) ? '/' . $this->baseUrl->getURLPath() : '')); @@ -143,10 +150,6 @@ class Introduction extends BaseFactory // Normal connection requests } else { - if (empty($notification['url'])) { - continue; - } - // Don't show these data until you are connected. Diaspora is doing the same. if ($notification['network'] === Protocol::DIASPORA) { $notification['location'] = "";