[FIX] mail: prevents crash in some channelMember inserts
Before this commit, we were trying to access `channelMember.thread.channelMembers` when inserting a member, but some inserts come without this key. A traceback could occur when inserts of `rtcSession` records came with a `channelMember` with little information on their thread. closes odoo/odoo#116656 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -37,7 +37,7 @@ export class ChannelMemberService {
|
||||
switch (command) {
|
||||
case "insert":
|
||||
{
|
||||
if (!member.thread.channelMembers.includes(member)) {
|
||||
if (!member.thread?.channelMembers?.includes(member)) {
|
||||
member.thread.channelMembers.push(member);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user