return null if either requestId or requestType are undefined

This commit is contained in:
Travis Eden 2018-11-12 10:20:41 -05:00
parent b4ed8f7699
commit 0b2b7fff92
2 changed files with 7 additions and 0 deletions

View file

@ -44,6 +44,10 @@ var getCanonicalUrlFromShow = function getCanonicalUrlFromShow(show) {
var requestId = show.requestList[show.request.id];
var requestType = show.request.type;
if (!requestId || !requestType) {
return null;
}
switch (requestType) {
case 'ASSET_DETAILS':
var asset = show.assetList[requestId.key];

View file

@ -20,6 +20,9 @@ const createCanonicalLink = require('../../../utils/createCanonicalLink');
const getCanonicalUrlFromShow = show => {
const requestId = show.requestList[show.request.id];
const requestType = show.request.type;
if (!requestId || !requestType) {
return null;
}
switch (requestType) {
case 'ASSET_DETAILS':
const asset = show.assetList[requestId.key];