Check for reply existence before using its values in Model\Mail

- Address https://github.com/friendica/friendica/issues/10474#issuecomment-925263894
This commit is contained in:
Hypolite Petovan 2021-09-25 20:45:53 -04:00
parent 9d77958247
commit 0bb169b4ed

View File

@ -74,9 +74,7 @@ class Mail
return false;
}
if ($msg['reply']) {
$reply = DBA::selectFirst('mail', ['uri', 'uri-id'], ['parent-uri' => $msg['parent-uri'], 'reply' => false]);
if ($msg['reply'] && DBA::isResult($reply = DBA::selectFirst('mail', ['uri', 'uri-id'], ['parent-uri' => $msg['parent-uri'], 'reply' => false]))) {
$msg['thr-parent'] = $reply['uri'];
$msg['thr-parent-id'] = $reply['uri-id'];
} else {