[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) <tde@openerp.com>
This commit is contained in:
Thibault Delavallée
2022-06-28 10:23:43 +02:00
parent 7a2650760d
commit aa80de0f9e
+1 -1
View File
@@ -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