[FIX] component: properly handle mounting a destroyed component

part of #685
This commit is contained in:
Géry Debongnie
2020-04-22 09:20:54 +02:00
committed by aab-odoo
parent c36333dbbc
commit 559fadb62a
3 changed files with 26 additions and 4 deletions
+3
View File
@@ -316,6 +316,9 @@ export class Component<Props extends {} = any, T extends Env = Env> {
return Promise.resolve();
}
}
if (__owl__.isDestroyed) {
throw new Error("Cannot mount a destroyed component");
}
if (__owl__.currentFiber) {
const currentFiber = __owl__.currentFiber;
if (currentFiber.target === target && currentFiber.position === position) {