Browse Source

GLTFLoader: Return null when failing to load textures (#21977)

* GLTFLoader: Return null when failing to load textures

* GLTFLoader: Logging error when failing to load a texture.
Mr.doob 4 years ago
parent
commit
cf079d48a8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      examples/jsm/loaders/GLTFLoader.js

+ 5 - 0
examples/jsm/loaders/GLTFLoader.js

@@ -2643,6 +2643,11 @@ class GLTFParser {
 
 			return texture;
 
+		} ).catch( function () {
+
+			console.error( 'THREE.GLTFLoader: Couldn\'t load texture', sourceURI );
+			return null;
+
 		} );
 
 		this.textureCache[ cacheKey ] = promise;