From 486bbba4ca0a28db92b1cae7e6294e91ae47b7d9 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 12 Aug 2024 17:08:36 +0200 Subject: [PATCH] Bugfix: Attempt to read property "smimeSigned" on null --- .../app/libraries/RainLoop/Actions/Messages.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php index 8228f745b8..8b04bbdad2 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php @@ -480,6 +480,9 @@ public function DoMessage() : array try { $oMessage = $this->MailClient()->Message($sFolder, $iUid, true, $this->Cacher($oAccount)); + if (!$oMessage) { + throw new \RuntimeException('Message not found'); + } $bAutoVerify = $this->Config()->Get('security', 'auto_verify_signatures', false); @@ -572,13 +575,10 @@ public function DoMessage() : array throw new ClientException(Notifications::CantGetMessage, $oException); } - if ($oMessage) { - $ETag = $oMessage->ETag($this->getAccountFromToken()->ImapUser()); - $this->verifyCacheByKey($ETag); - $this->Plugins()->RunHook('filter.result-message', array($oMessage)); - $this->cacheByKey($ETag); - } - + $ETag = $oMessage->ETag($this->getAccountFromToken()->ImapUser()); + $this->verifyCacheByKey($ETag); + $this->Plugins()->RunHook('filter.result-message', array($oMessage)); + $this->cacheByKey($ETag); return $this->DefaultResponse($oMessage); }