From ce74099698dfe6ee5768ed5b852069367781a46a Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 13 Apr 2018 10:44:37 +0100 Subject: [PATCH] Null check node before we pass it to velocity As presumably sometimes the node wasn't actually in the DOM for whatever reason, so don't propagate exceptions out into the app. Should fix https://github.com/vector-im/riot-web/issues/6515 --- src/Velociraptor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Velociraptor.js b/src/Velociraptor.js index af4e6dcb60..6a4666305c 100644 --- a/src/Velociraptor.js +++ b/src/Velociraptor.js @@ -147,7 +147,7 @@ module.exports = React.createClass({ // creating/destroying large numbers of elements" // (https://github.com/julianshapiro/velocity/issues/47) const domNode = ReactDom.findDOMNode(this.nodes[k]); - Velocity.Utilities.removeData(domNode); + if (domNode) Velocity.Utilities.removeData(domNode); } this.nodes[k] = node; },