diff --git a/client/src/selectors/show.js b/client/src/selectors/show.js index b3b5ba92..d7358e8e 100644 --- a/client/src/selectors/show.js +++ b/client/src/selectors/show.js @@ -1,7 +1,13 @@ -export const selectAsset = (show) => { - const request = show.requestList[show.request.id]; - const assetKey = request.key; - return show.assetList[assetKey]; +export const selectAsset = show => { + const requestId = show.request.id; + let asset; + const request = show.requestList[requestId] || null; + const assetList = show.assetList; + if (request && assetList) { + const assetKey = request.key; // note: just store this in the request + asset = assetList[assetKey] || null; + } + return asset; }; export const selectShowState = (state) => {