Przeglądaj źródła

SkinnedMesh: Safer parent check. Fixes #8636.

Mr.doob 9 lat temu
rodzic
commit
5e9d77b753
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      src/objects/SkinnedMesh.js

+ 2 - 1
src/objects/SkinnedMesh.js

@@ -43,7 +43,8 @@ THREE.SkinnedMesh = function ( geometry, material, useVertexTexture ) {
 
 			gbone = this.geometry.bones[ b ];
 
-			if ( gbone.parent !== - 1 && gbone.parent !== null ) {
+			if ( gbone.parent !== - 1 && gbone.parent !== null &&
+					bones[ gbone.parent ] !== undefined ) {
 
 				bones[ gbone.parent ].add( bones[ b ] );