Przeglądaj źródła

ObjectLoader: material can be undefined.

Mr.doob 10 lat temu
rodzic
commit
22de744d50
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      src/loaders/ObjectLoader.js

+ 2 - 0
src/loaders/ObjectLoader.js

@@ -461,6 +461,8 @@ THREE.ObjectLoader.prototype = {
 
 			var getMaterial = function ( name ) {
 
+				if ( name === undefined ) return undefined;
+
 				if ( materials[ name ] === undefined ) {
 
 					console.warn( 'THREE.ObjectLoader: Undefined material', name );