Some null checks in animation code

pull/21833/head
David Baker 2016-01-08 16:43:25 +00:00
parent 223f6f7914
commit b37ea52a1f
1 changed files with 2 additions and 1 deletions

View File

@ -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