From c2989908c84e960b8ff79f1af32a93fc03942d10 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 19 Oct 2010 05:07:06 +0000 Subject: [PATCH] BUGFIX #6089 Avoid javascript error when "Allow drag & drop reordering" enabled, and attempt to drag a file from one folder to another is performed (from r111932) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112945 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/tree/tree.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/javascript/tree/tree.js b/javascript/tree/tree.js index d2813b10ead..c945bd29b03 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) {