소스 검색

GLTFLoader: Don't fail when node is undefined.

Mr.doob 8 년 전
부모
커밋
6a966dd5d3
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  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 group = dependencies.meshes[ mesh ];
 
+							if ( group === undefined ) {
+
+								console.warn( 'GLTFLoader: Couldn\'t find node "' + mesh + '".' );
+								continue;
+
+							}
+
 							for ( var childrenId in group.children ) {
 
 								var child = group.children[ childrenId ];