This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new 1b07eca  Don't crash on get if email not found
1b07eca is described below

commit 1b07eca829191c7d278fd7b67a96bc06b39d4781
Author: Sebb <[email protected]>
AuthorDate: Thu Nov 11 17:46:08 2021 +0000

    Don't crash on get if email not found
---
 server/endpoints/email.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/endpoints/email.py b/server/endpoints/email.py
index dcfad60..1ff6fdd 100644
--- a/server/endpoints/email.py
+++ b/server/endpoints/email.py
@@ -39,6 +39,9 @@ async def process(
     if email is None:
         email = await plugins.messages.get_email(session, 
messageid=indata.get("id"))
 
+    if email is None:
+        return aiohttp.web.Response(headers={}, status=404, text="Email not 
found")
+
     # If email was found, process the request if we are allowed to display it
     cannot_view = email.get("deleted", False)
     if session.credentials and session.credentials.admin:

Reply via email to