[FIX] mail: prevent crash when cancelling message edit

task-2917199

closes odoo/odoo#95814

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This commit is contained in:
Sébastien Theys
2022-07-12 13:21:30 +02:00
parent 2fbfbf0dce
commit 2e4ae1f5fb
@@ -50,6 +50,7 @@ registerModel({
discard() {
if (this.messageViewInEditing) {
this.messageViewInEditing.stopEditing();
return;
}
if (this.threadView && this.threadView.replyingToMessageView) {
const { threadView } = this;
@@ -180,7 +181,9 @@ registerModel({
*/
onClickCancelLink(ev) {
ev.preventDefault();
this.discard();
if (this.exists()) {
this.discard();
}
},
/**
* Discards the composer when clicking away.