Browse Source

Merge pull request #11959 from takahirox/FixGLTF2Loader

Check asset existence to detect glTF version
Mr.doob 8 years ago
parent
commit
597416007c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/js/loaders/GLTF2Loader.js

+ 1 - 1
examples/js/loaders/GLTF2Loader.js

@@ -79,7 +79,7 @@ THREE.GLTF2Loader = ( function () {
 
 			var json = JSON.parse( content );
 
-			if ( json.asset.version[0] < 2 ) {
+			if ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) {
 
 				onError( new Error( 'THREE.GLTF2Loader: Legacy glTF detected. Use THREE.GLTFLoader instead.' ) );
 				return;