Fix Fatal error: Uncaught TypeError: Argument 1 passed to Friendica\Model\Contact::getByURL() must be of the type string, null given

This commit is contained in:
Michael 2020-10-20 15:15:33 +00:00
parent 4719af6724
commit 097e3d6dcc
1 changed files with 8 additions and 5 deletions

View File

@ -115,10 +115,17 @@ class Introduction extends BaseFactory
); );
while ($notification = $this->dba->fetch($stmtNotifications)) { 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. // We have to distinguish between these two because they use different data.
// Contact suggestions // Contact suggestions
if ($notification['fid'] ?? '') { if ($notification['fid'] ?? '') {
if (empty($notification['furl'])) {
continue;
}
$return_addr = bin2hex($this->nick . '@' . $return_addr = bin2hex($this->nick . '@' .
$this->baseUrl->getHostName() . $this->baseUrl->getHostName() .
(($this->baseUrl->getURLPath()) ? '/' . $this->baseUrl->getURLPath() : '')); (($this->baseUrl->getURLPath()) ? '/' . $this->baseUrl->getURLPath() : ''));
@ -143,10 +150,6 @@ class Introduction extends BaseFactory
// Normal connection requests // Normal connection requests
} else { } else {
if (empty($notification['url'])) {
continue;
}
// Don't show these data until you are connected. Diaspora is doing the same. // Don't show these data until you are connected. Diaspora is doing the same.
if ($notification['network'] === Protocol::DIASPORA) { if ($notification['network'] === Protocol::DIASPORA) {
$notification['location'] = ""; $notification['location'] = "";