From aa80de0f9e25a54f7fe44bdbac89e5095179f29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 24 Jun 2022 13:49:12 +0000 Subject: [PATCH] [FIX] portal: don't crash in chatter_post if no attachments Default value for attachment_ids / tokens is None. However a check method consider those as lists and check their length. When calling chatter_post without giving at least a void list there is therefore a crash that can be easily avoided. closes odoo/odoo#94695 Signed-off-by: Thibault Delavallee (tde) --- addons/portal/controllers/mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal/controllers/mail.py b/addons/portal/controllers/mail.py index 1b53274e084..d019a9e1265 100644 --- a/addons/portal/controllers/mail.py +++ b/addons/portal/controllers/mail.py @@ -131,7 +131,7 @@ class PortalChatter(http.Controller): res_id = int(res_id) - self._portal_post_check_attachments(attachment_ids, attachment_tokens) + self._portal_post_check_attachments(attachment_ids or [], attachment_tokens or []) result = {'default_message': message} # message is received in plaintext and saved in html