Skip to content

Commit 2c6d6f1

Browse files
committed
[FIX] mail: no crash on test test_04_meeting_view_tour avatarUrl
Before this commit, test `test_04_meeting_view_tour` could crash non-deterministically with the following error: ``` OwlError: An error occured in the owl lifecycle (see this Error's "cause" property) Caused by: TypeError: Cannot read properties of undefined (reading 'avatarUrl') at DiscussSidebarCallParticipants.template ``` This happens because the template was reading a deep field in a JS relation without guard in `rtc_session.channel_member_id.avatarUrl`. When a rtc_session is known in client code, the `channel_member_id` is not necessarily known, therefore code should guard it unless context is explicit that this is known. This commit adds optional guarding in the template to take into account possibility to know rtc session without the related channel member id. Fixes runbot-error-233597 closes odoo#233232 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
1 parent ce13cf7 commit 2c6d6f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

addons/mail/static/src/discuss/call/public_web/discuss_app/sidebar/call_participants.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@
6767
<t t-name="mail.DiscussSidebarCallParticipants.participant">
6868
<div class="o-mail-DiscussSidebarCallParticipants-participant d-flex text-reset overflow-hidden align-items-center" t-att-class="attClass" t-on-click="(ev) => this.onClickParticipant(ev, session)">
6969
<div class="bg-inherit position-relative d-flex flex-shrink-0" style="width:26px;height:26px;margin:1px;">
70-
<img class="o-mail-DiscussSidebarCallParticipants-avatar w-100 h-100 rounded-circle object-fit-cover" t-att-src="session.channel_member_id.avatarUrl" t-att-class="{'o-isTalking': !session.isMute and session.isTalking}" alt="Participant avatar" t-att-title="session.channel_member_id.name"/>
70+
<img class="o-mail-DiscussSidebarCallParticipants-avatar w-100 h-100 rounded-circle object-fit-cover" t-att-src="session.channel_member_id?.avatarUrl" t-att-class="{'o-isTalking': !session.isMute and session.isTalking}" alt="Participant avatar" t-att-title="session.channel_member_id?.name"/>
7171
</div>
72-
<span t-if="!isCompact" class="o-mail-DiscussSidebarCallParticipants-name mx-1 text-truncate fw-bold smaller user-select-none" t-att-title="session.channel_member_id.name" t-att-class="{ 'o-isTalking': !session.isMute and session.isTalking }">
73-
<t t-esc="session.channel_member_id.name"/>
72+
<span t-if="!isCompact" class="o-mail-DiscussSidebarCallParticipants-name mx-1 text-truncate fw-bold smaller user-select-none" t-att-title="session.channel_member_id?.name" t-att-class="{ 'o-isTalking': !session.isMute and session.isTalking }">
73+
<t t-esc="session.channel_member_id?.name"/>
7474
</span>
7575
<div t-if="!isCompact" class="flex-grow-1"/>
7676
<div class="o-mail-DiscussSidebarCallParticipants-status small opacity-75" t-att-class="{ 'position-absolute bottom-0 end-0 bg-inherit p-0 rounded-circle o-compact d-flex o-xsmaller text-start': isCompact, 'ms-1 d-flex align-items-center justify-content-center': !isCompact }">

0 commit comments

Comments
 (0)