Procházet zdrojové kódy

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 před 1 rokem
rodič
revize
cde048c252
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  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 ];