fix: check both static list and remote list before raising error

This commit is contained in:
Artsiom Aliakseyenka
2019-04-01 12:46:24 +03:00
committed by Alexander Cerutti
parent 98c4d47f48
commit f35c4cf5e4

View File

@@ -107,8 +107,9 @@ class Pass {
.then(([modelFileList, remoteFilesList, remoteBuffers]) => { .then(([modelFileList, remoteFilesList, remoteBuffers]) => {
// list without dynamic components like manifest, signature or pass files (will be added later in the flow) and hidden files. // list without dynamic components like manifest, signature or pass files (will be added later in the flow) and hidden files.
let noDynList = removeHidden(modelFileList).filter(f => !/(manifest|signature|pass)/i.test(f)); let noDynList = removeHidden(modelFileList).filter(f => !/(manifest|signature|pass)/i.test(f));
const hasAssets = noDynList.length || remoteFilesList.length;
if (!noDynList.length || ![...noDynList, ...remoteFilesList].some(f => f.toLowerCase().includes("icon"))) { if (!hasAssets || ![...noDynList, ...remoteFilesList].some(f => f.toLowerCase().includes("icon"))) {
let eMessage = formatMessage("MODEL_UNINITIALIZED", path.parse(this.model).name); let eMessage = formatMessage("MODEL_UNINITIALIZED", path.parse(this.model).name);
throw new Error(eMessage); throw new Error(eMessage);
} }