Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: nullish check for vnode (#925)
  • Loading branch information
liaoyinglong committed Apr 27, 2022
1 parent 7a416db commit 293f03b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/utils/instance.ts
Expand Up @@ -107,11 +107,13 @@ function updateTemplateRef(vm: ComponentInstance) {
export function afterRender(vm: ComponentInstance) {
const stack = [(vm as any)._vnode as VNode]
while (stack.length) {
const vnode = stack.pop()!
if (vnode.context) updateTemplateRef(vnode.context)
if (vnode.children) {
for (let i = 0; i < vnode.children.length; ++i) {
stack.push(vnode.children[i])
const vnode = stack.pop()
if (vnode) {
if (vnode.context) updateTemplateRef(vnode.context)
if (vnode.children) {
for (let i = 0; i < vnode.children.length; ++i) {
stack.push(vnode.children[i])
}
}
}
}
Expand Down

0 comments on commit 293f03b

Please sign in to comment.