[FIX] mail: check existence of record in FollowerListMenu
This commit fixes a race condition that makes several tours crash. The reason is that the underlying record is removed from the model which produces a re-rendering. At the end of that re-rendering, a component is unmounted. At that point, we remove an handler relying on the existence of the record. As a consequence, there was a short time window during which the handler would crash if it was called. Part-of: odoo/odoo#92475
This commit is contained in:
@@ -57,6 +57,9 @@ export class FollowerListMenu extends Component {
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
_onClickCaptureGlobal(ev) {
|
||||
if (!this.followerListMenuView.exists()) {
|
||||
return;
|
||||
}
|
||||
// since dropdown is conditionally shown based on state, dropdownRef can be null
|
||||
if (this._dropdownRef.el && !this._dropdownRef.el.contains(ev.target)) {
|
||||
this.followerListMenuView.hide();
|
||||
|
||||
Reference in New Issue
Block a user