From: Hypolite Petovan Date: Sun, 26 Sep 2021 00:45:53 +0000 (-0400) Subject: Check for reply existence before using its values in Model\Mail X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0bb169b4edc09a99d14fa9105412c114b1bcc6f6;p=friendica.git Check for reply existence before using its values in Model\Mail - Address https://github.com/friendica/friendica/issues/10474#issuecomment-925263894 --- diff --git a/src/Model/Mail.php b/src/Model/Mail.php index 7eaeb09b5e..75515c5df5 100644 --- a/src/Model/Mail.php +++ b/src/Model/Mail.php @@ -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 {