mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] components/fiber: Call patch only if target is valid
Currently in some cases, adding an attachment via lognote creates a traceback. Error : shouldPatch is true while `vnode` is not defined, so `patch()` failed This is a hotfix correcting this problem by calling `patch()` only if `shouldPatch` is true **and** the `vnode` is set. opw-2645203
This commit is contained in:
committed by
Géry Debongnie
parent
4e3b7c74da
commit
6950f8e628
@@ -243,8 +243,9 @@ export class Fiber {
|
|||||||
}
|
}
|
||||||
component.__patch(target!, fiber.vnode!);
|
component.__patch(target!, fiber.vnode!);
|
||||||
} else {
|
} else {
|
||||||
if (fiber.shouldPatch) {
|
const vnode = component.__owl__.vnode;
|
||||||
component.__patch(component.__owl__.vnode!, fiber.vnode!);
|
if (fiber.shouldPatch && vnode) {
|
||||||
|
component.__patch(vnode, fiber.vnode!);
|
||||||
// When updating a Component's props (in directive),
|
// When updating a Component's props (in directive),
|
||||||
// the component has a pvnode AND should be patched.
|
// the component has a pvnode AND should be patched.
|
||||||
// However, its pvnode.elm may have changed if it is a High Order Component
|
// However, its pvnode.elm may have changed if it is a High Order Component
|
||||||
|
|||||||
Reference in New Issue
Block a user