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 requestId = show.requestList[show.request.id];
|
||||||
var requestType = show.request.type;
|
var requestType = show.request.type;
|
||||||
|
|
||||||
|
if (!requestId || !requestType) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
switch (requestType) {
|
switch (requestType) {
|
||||||
case 'ASSET_DETAILS':
|
case 'ASSET_DETAILS':
|
||||||
var asset = show.assetList[requestId.key];
|
var asset = show.assetList[requestId.key];
|
||||||
|
|
|
@ -20,6 +20,9 @@ const createCanonicalLink = require('../../../utils/createCanonicalLink');
|
||||||
const getCanonicalUrlFromShow = show => {
|
const getCanonicalUrlFromShow = show => {
|
||||||
const requestId = show.requestList[show.request.id];
|
const requestId = show.requestList[show.request.id];
|
||||||
const requestType = show.request.type;
|
const requestType = show.request.type;
|
||||||
|
if (!requestId || !requestType) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
switch (requestType) {
|
switch (requestType) {
|
||||||
case 'ASSET_DETAILS':
|
case 'ASSET_DETAILS':
|
||||||
const asset = show.assetList[requestId.key];
|
const asset = show.assetList[requestId.key];
|
||||||
|
|
Loading…
Add table
Reference in a new issue