瀏覽代碼

Fix for delete

Josh Engebretson 10 年之前
父節點
當前提交
64ddf6eb7a

+ 2 - 1
Data/AtomicEditor/Resources/EditorData/AtomicEditor/typescript/ui/inspector/NodeInspector.ts

@@ -35,7 +35,8 @@ class NodeInspector extends ScriptWidget {
                 this.nodeLayout.deleteAllChildren();
                 this.nodeLayout.deleteAllChildren();
                 this.nodeLayout = null;
                 this.nodeLayout = null;
                 this.node.removeComponents(true, true);
                 this.node.removeComponents(true, true);
-                this.node.parent.removeChild(this.node);
+                if (this.node.parent)
+                  this.node.parent.removeChild(this.node);
                 this.node = null;
                 this.node = null;
                 this.sendEvent("EditorActiveNodeChange", { node: null });
                 this.sendEvent("EditorActiveNodeChange", { node: null });
                 this.sendEvent("EditorUpdateHierarchy", {});
                 this.sendEvent("EditorUpdateHierarchy", {});