Double check that contents settings exist

… before using them.
HFP-714
JI-92-path-fix
Frode Petterson 2017-02-06 14:39:59 +01:00
parent 9abe7ef321
commit 26d0a3a341
1 changed files with 2 additions and 1 deletions

View File

@ -661,7 +661,8 @@ H5P.getPath = function (path, contentId) {
var prefix; var prefix;
if (contentId !== undefined) { if (contentId !== undefined) {
// Check for custom override URL // Check for custom override URL
if (H5PIntegration.contents !== undefined) { if (H5PIntegration.contents !== undefined &&
H5PIntegration.contents['cid-' + contentId]) {
prefix = H5PIntegration.contents['cid-' + contentId].contentUrl; prefix = H5PIntegration.contents['cid-' + contentId].contentUrl;
} }
if (!prefix) { if (!prefix) {