Skip to content

Commit

Permalink
fix(asset): safely handle case where file is null (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Kent authored and Khaledgarbaya committed Oct 25, 2017
1 parent fb210e4 commit 93b36a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/entities/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function createAssetApi (http) {

function processForAllLocales (options = {}) {
const self = this
const locales = Object.keys(this.fields.file)
const locales = Object.keys(this.fields.file || {})
return Promise.all(locales.map((locale) => processForLocale.call(self, locale, options)))
.then((assets) => assets[0])
}
Expand Down

0 comments on commit 93b36a7

Please sign in to comment.