Browse Source

Editor: Make changing of Object3D.receiveShadow more robust.

Mugen87 5 years ago
parent
commit
45435e10b7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      editor/js/Sidebar.Object.js

+ 1 - 1
editor/js/Sidebar.Object.js

@@ -568,7 +568,7 @@ var SidebarObject = function ( editor ) {
 
 
 			if ( object.receiveShadow !== undefined && object.receiveShadow !== objectReceiveShadow.getValue() ) {
 			if ( object.receiveShadow !== undefined && object.receiveShadow !== objectReceiveShadow.getValue() ) {
 
 
-				object.material.needsUpdate = true;
+				if ( object.material !== undefined ) object.material.needsUpdate = true;
 				editor.execute( new SetValueCommand( editor, object, 'receiveShadow', objectReceiveShadow.getValue() ) );
 				editor.execute( new SetValueCommand( editor, object, 'receiveShadow', objectReceiveShadow.getValue() ) );
 
 
 			}
 			}