fix(@embark/pipeline): Prevent crash when assets not specified

Prevent embark from crashing when app assets are not specified in `embark.json`.

Previously, if the `app` property of `embark.json` was missing, embark would crash with the error `TypeError: Cannot convert undefined or null to object`.

With this PR, the missing property is null-checked.
This commit is contained in:
emizzle 2019-03-12 12:56:15 +11:00 committed by Iuri Matias
parent 5ea4807c90
commit 3aafde3335
1 changed files with 1 additions and 0 deletions

View File

@ -563,6 +563,7 @@ Config.prototype.loadPipelineConfigFile = function() {
};
Config.prototype.loadAssetFiles = function () {
if(!this.embarkConfig.app) return;
Object.keys(this.embarkConfig.app).forEach(targetFile => {
this.assetFiles[targetFile] = this.loadFiles(this.embarkConfig.app[targetFile]);
});