Browse Source

ColladaLoader2: Return if text is empty (out of memory?)

Mr.doob 9 năm trước cách đây
mục cha
commit
8c3b23412f
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      examples/js/loaders/ColladaLoader2.js

+ 6 - 0
examples/js/loaders/ColladaLoader2.js

@@ -1387,6 +1387,12 @@ THREE.ColladaLoader.prototype = {
 
 		console.time( 'ColladaLoader' );
 
+		if ( text.length === 0 ) {
+
+			return { scene: new THREE.Scene() };
+
+		}
+
 		console.time( 'ColladaLoader: DOMParser' );
 
 		var xml = new DOMParser().parseFromString( text, 'application/xml' );