fix crash when null source path

This commit is contained in:
Lachlan Kermode
2018-12-26 10:05:11 +01:00
parent ad69b1914b
commit 1bf022944a
3 changed files with 26 additions and 17 deletions

View File

@@ -166,10 +166,12 @@ export const selectSelected = createSelector(
if (selected.length === 0) {
return []
}
// NB: return source object if exists, otherwise null
const srcs = selected
.map(e => e.sources)
.map(_sources =>
_sources.map(id => sources[id])
_sources.map(id => (sources.hasOwnProperty(id) ? sources[id] : null))
)
return selected.map((s, idx) => ({