浏览代码

fix bug on removeChild()

bstouls 9 年之前
父节点
当前提交
4499982f58
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      hxd/inspect/TreeNode.hx

+ 1 - 1
hxd/inspect/TreeNode.hx

@@ -28,7 +28,7 @@ class TreeNode extends Node {
 	override function removeChild(n:Node) {
 		super.removeChild(n);
 		n.j.detach();
-		if( jchild.get().numChildren == 0 ) {
+		if( jchild != null && jchild.get().numChildren == 0 ) {
 			jchild.remove();
 			jchild = null;
 		}