浏览代码

GLTFExporter: Return an empty object if fails to serialize userData

Takahiro 7 年之前
父节点
当前提交
affb727f1e
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      examples/js/exporters/GLTFExporter.js

+ 2 - 0
examples/js/exporters/GLTFExporter.js

@@ -342,6 +342,8 @@ THREE.GLTFExporter.prototype = {
 				console.warn( 'THREE.GLTFExporter: userData of \'' + object.name + '\' ' +
 					'won\'t be serialized because of JSON.stringify error - ' + error.message );
 
+				return {};
+
 			}
 
 		}