ソースを参照

3MFLoader: Throw error on missing rels. (#27955)

* THREE.ThreeMFLoader: Throw error on missing rels

This throws an error in case the 3MF file is malformed and is missing
the `rels` object. Otherwise, the error is a bit cryptic.

* Move rels check to loadDocument
Nicolas Mattia 1 年間 前
コミット
cde048c252
1 ファイル変更2 行追加0 行削除
  1. 2 0
      examples/jsm/loaders/3MFLoader.js

+ 2 - 0
examples/jsm/loaders/3MFLoader.js

@@ -144,6 +144,8 @@ class ThreeMFLoader extends Loader {
 
 			}
 
+			if ( relsName === undefined ) throw new Error( 'THREE.ThreeMFLoader: Cannot find relationship file `rels` in 3MF archive.' );
+
 			//
 
 			const relsView = zip[ relsName ];