Skip to content

Commit

Permalink
fix(@embark/pipeline): Prevent crash when assets not specified
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
emizzle authored and iurimatias committed Mar 12, 2019
1 parent 5ea4807 commit 3aafde3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/embark/src/lib/core/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
});
Expand Down

0 comments on commit 3aafde3

Please sign in to comment.