return null if either requestId or requestType are undefined
This commit is contained in:
parent
b4ed8f7699
commit
0b2b7fff92
2 changed files with 7 additions and 0 deletions
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue