fix null ref when updating component root from null to something

This commit is contained in:
Leo Horie 2016-07-08 14:57:10 -04:00
parent a988276e9b
commit abadcfc13a
2 changed files with 28 additions and 1 deletions

View file

@ -243,7 +243,8 @@ module.exports = function($window) {
vnode.instance = Node.normalize(vnode.tag.view.call(vnode.state, vnode))
updateLifecycle(vnode.tag, vnode, hooks, recycling)
if (vnode.instance != null) {
updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)
if (old.instance == null) insertNode(parent, createNode(vnode.instance, hooks, ns), nextSibling)
else updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)
vnode.dom = vnode.instance.dom
vnode.domSize = vnode.instance.domSize
}