]> git.mxchange.org Git - friendica.git/commitdiff
Check for reply existence before using its values in Model\Mail
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Sep 2021 00:45:53 +0000 (20:45 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Sep 2021 12:15:07 +0000 (08:15 -0400)
- Address https://github.com/friendica/friendica/issues/10474#issuecomment-925263894

src/Model/Mail.php

index 7eaeb09b5e6ba85b6866a84bd8f56f0c13869f37..75515c5df53c8166e5d0240ea570a4120f6525cf 100644 (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 {