Browse Source

fixed error for ordering of null check

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

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

@@ -1646,9 +1646,12 @@ THREE.GLTFExporter.prototype = {
 			var node = outputJSON.nodes[ nodeMap.get( object ) ];
 			var node = outputJSON.nodes[ nodeMap.get( object ) ];
 
 
 			var skeleton = object.skeleton;
 			var skeleton = object.skeleton;
+
+			if ( skeleton === undefined ) return null;
+
 			var rootJoint = object.skeleton.bones[ 0 ];
 			var rootJoint = object.skeleton.bones[ 0 ];
 
 
-			if ( skeleton === undefined || rootJoint === undefined ) return null;
+			if ( rootJoint === undefined ) return null;
 
 
 			var joints = [];
 			var joints = [];
 			var inverseBindMatrices = new Float32Array( skeleton.bones.length * 16 );
 			var inverseBindMatrices = new Float32Array( skeleton.bones.length * 16 );