Browse Source

GLTFLoader: Don't fail when node is undefined.

Mr.doob 8 years ago
parent
commit
6a966dd5d3
1 changed files with 7 additions and 0 deletions
  1. 7 0
      examples/js/loaders/GLTFLoader.js

+ 7 - 0
examples/js/loaders/GLTFLoader.js

@@ -1487,6 +1487,13 @@ THREE.GLTFLoader = ( function () {
 							var mesh = node.meshes[ meshId ];
 							var mesh = node.meshes[ meshId ];
 							var group = dependencies.meshes[ mesh ];
 							var group = dependencies.meshes[ mesh ];
 
 
+							if ( group === undefined ) {
+
+								console.warn( 'GLTFLoader: Couldn\'t find node "' + mesh + '".' );
+								continue;
+
+							}
+
 							for ( var childrenId in group.children ) {
 							for ( var childrenId in group.children ) {
 
 
 								var child = group.children[ childrenId ];
 								var child = group.children[ childrenId ];