Prechádzať zdrojové kódy

ColladaLoader: Extra checks for effect.surface.

Mr.doob 12 rokov pred
rodič
commit
5101e94395
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      examples/js/loaders/ColladaLoader.js

+ 3 - 3
examples/js/loaders/ColladaLoader.js

@@ -3142,11 +3142,11 @@ THREE.ColladaLoader = function () {
 						if ( cot.isTexture() ) {
 
 							var samplerId = cot.texture;
-							var surfaceId = this.effect.sampler[samplerId].source;
+							var surfaceId = this.effect.sampler[samplerId];
 
-							if ( surfaceId ) {
+							if ( surfaceId !== undefined && surfaceId.source !== undefined ) {
 
-								var surface = this.effect.surface[surfaceId];
+								var surface = this.effect.surface[surfaceId.source];
 								var image = images[surface.init_from];
 
 								if (image) {