2
0
Эх сурвалжийг харах

Editor: Prevent runtime erros when deleting objects.

Mugen87 5 жил өмнө
parent
commit
cba818faa4

+ 4 - 3
editor/js/Menubar.Edit.js

@@ -118,10 +118,11 @@ var MenubarEdit = function ( editor ) {
 
 		var object = editor.selected;
 
-		var parent = object.parent;
-		if ( parent === undefined ) return; // avoid deleting the camera or scene
+		if ( object !== null && object.parent !== null ) {
 
-		editor.execute( new RemoveObjectCommand( editor, object ) );
+			editor.execute( new RemoveObjectCommand( editor, object ) );
+
+		}
 
 	} );
 	options.add( option );