Check if contents is set before using

h5p/h5p-moodle-plugin#112
JI-92-path-fix
Frode Petterson 2016-09-09 09:19:55 +02:00
parent e8f90c9116
commit c88c049438
1 changed files with 3 additions and 1 deletions

View File

@ -692,7 +692,9 @@ 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) {
prefix = H5PIntegration.contents['cid-' + contentId].contentUrl; prefix = H5PIntegration.contents['cid-' + contentId].contentUrl;
}
if (!prefix) { if (!prefix) {
prefix = H5PIntegration.url + '/content/' + contentId; prefix = H5PIntegration.url + '/content/' + contentId;
} }