mirror of
https://github.com/friendica/friendica
synced 2024-11-10 11:42:54 +00:00
Merge pull request #8946 from annando/fix-fatal
Possibly fix a fatal error
This commit is contained in:
commit
f4e1acedfc
1 changed files with 10 additions and 1 deletions
|
@ -207,7 +207,12 @@ class Contact
|
||||||
if (empty($cid)) {
|
if (empty($cid)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return self::getById($cid, $fields);
|
|
||||||
|
$contact = self::getById($cid, $fields);
|
||||||
|
if (empty($contact)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return $contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add internal fields
|
// Add internal fields
|
||||||
|
@ -238,6 +243,10 @@ class Contact
|
||||||
$contact = DBA::selectFirst('contact', $fields, $condition, $options);
|
$contact = DBA::selectFirst('contact', $fields, $condition, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!DBA::isResult($contact)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
// Update the contact in the background if needed
|
// Update the contact in the background if needed
|
||||||
if ((($contact['updated'] < DateTimeFormat::utc('now -7 days')) || empty($contact['avatar'])) &&
|
if ((($contact['updated'] < DateTimeFormat::utc('now -7 days')) || empty($contact['avatar'])) &&
|
||||||
in_array($contact['network'], Protocol::FEDERATED)) {
|
in_array($contact['network'], Protocol::FEDERATED)) {
|
||||||
|
|
Loading…
Reference in a new issue