diff --git a/javascript/tree/tree.js b/javascript/tree/tree.js index d2813b10e..c945bd29b 100644 --- a/javascript/tree/tree.js +++ b/javascript/tree/tree.js @@ -143,6 +143,8 @@ Tree.prototype = { * If 'before' is specified, then it will be inserted before that. */ appendTreeNode : function(child, before) { + if(!child) return; + // Remove from the old parent node - this will ensure that the classes of the old tree // item are updated accordingly if(child && child.parentTreeNode) {