From b37ea52a1f062fc29eaf7edd94637a485c0bb962 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Jan 2016 16:43:25 +0000 Subject: [PATCH] Some null checks in animation code --- src/Velociraptor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Velociraptor.js b/src/Velociraptor.js index d973a17f7f..066b1e2d05 100644 --- a/src/Velociraptor.js +++ b/src/Velociraptor.js @@ -36,7 +36,7 @@ module.exports = React.createClass({ var old = oldChildren[c.key]; var oldNode = ReactDom.findDOMNode(self.nodes[old.key]); - if (oldNode.style.left != c.props.style.left) { + if (oldNode && oldNode.style.left != c.props.style.left) { Velocity(oldNode, { left: c.props.style.left }, self.props.transition).then(function() { // special case visibility because it's nonsensical to animate an invisible element // so we always hidden->visible pre-transition and visible->hidden after @@ -73,6 +73,7 @@ module.exports = React.createClass({ collectNode: function(k, node) { if ( + node && this.nodes[k] === undefined && node.props.startStyle && Object.keys(node.props.startStyle).length