Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2022-01-25 21:39:28 +0300
committerAnna Larch <anna@nextcloud.com>2022-06-14 19:41:11 +0300
commit1b965d682982b1f05d60646b58d26709639cb84b (patch)
treeb99eec344332b0471f872830bed08368dc1a19ec /lib/Controller/MessagesController.php
parentf1f4a287ce3b2074759ef959f42af1639ab4daa6 (diff)
Handle empty thread root id
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'lib/Controller/MessagesController.php')
-rwxr-xr-xlib/Controller/MessagesController.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Controller/MessagesController.php b/lib/Controller/MessagesController.php
index 0ec4bdea7..36945b46c 100755
--- a/lib/Controller/MessagesController.php
+++ b/lib/Controller/MessagesController.php
@@ -134,7 +134,6 @@ class MessagesController extends Controller {
ITrustedSenderService $trustedSenderService,
IMailTransmission $mailTransmission) {
parent::__construct($appName, $request);
-
$this->accountService = $accountService;
$this->mailManager = $mailManager;
$this->mailSearch = $mailSearch;
@@ -328,6 +327,10 @@ class MessagesController extends Controller {
return new JSONResponse([], Http::STATUS_FORBIDDEN);
}
+ if (empty($message->getThreadRootId())) {
+ return new JSONResponse([], Http::STATUS_NOT_FOUND);
+ }
+
return new JSONResponse($this->mailManager->getThread($account, $message->getThreadRootId()));
}