[FIX] mail: no traceback when deleting a message

Before this commit, when deleting a message, there was a traceback.
This was caused by `MessageView/onComponentUpdate` wrongly assuming
`MessageView` from a single branching of identifying owner
(`messageListViewItemOwner`), when there is another one
(`deleteMessageConfirmViewOwner`), specific to when a message is
being deleted.

As a result, crash came from programming error of accessor on
undefined relational field.

Task-3055205

closes odoo/odoo#104995

X-original-commit: 1fbc125451c62b444ce49fa11c8216e52e299b64
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-11-04 14:00:42 +01:00
parent da27a4d5f1
commit b3de4ee4bd
@@ -127,7 +127,7 @@ registerModel({
this.highlight();
this.update({ doHighlight: clear() });
}
if (this.messageListViewItemOwner.threadViewOwnerAsLastMessageListViewItem && this.messageListViewItemOwner.isPartiallyVisible()) {
if (this.messageListViewItemOwner && this.messageListViewItemOwner.threadViewOwnerAsLastMessageListViewItem && this.messageListViewItemOwner.isPartiallyVisible()) {
this.messageListViewItemOwner.threadViewOwnerAsLastMessageListViewItem.handleVisibleMessage(this.message);
}
if (this.prettyBodyRef.el && this.message.prettyBody !== this.lastPrettyBody) {