Browse Source

Add null check for skeleton while processing skinned mesh for export

tiptopanonymous 5 years ago
parent
commit
d709d1580b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/js/exporters/GLTFExporter.js

+ 1 - 1
examples/js/exporters/GLTFExporter.js

@@ -1648,7 +1648,7 @@ THREE.GLTFExporter.prototype = {
 			var skeleton = object.skeleton;
 			var rootJoint = object.skeleton.bones[ 0 ];
 
-			if ( rootJoint === undefined ) return null;
+			if ( skeleton === undefined || rootJoint === undefined ) return null;
 
 			var joints = [];
 			var inverseBindMatrices = new Float32Array( skeleton.bones.length * 16 );