From 0bb169b4edc09a99d14fa9105412c114b1bcc6f6 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 25 Sep 2021 20:45:53 -0400 Subject: [PATCH] Check for reply existence before using its values in Model\Mail - Address https://github.com/friendica/friendica/issues/10474#issuecomment-925263894 --- src/Model/Mail.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 {