From c88c049438257b30e61801a940167d8805732ff0 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 9 Sep 2016 09:19:55 +0200 Subject: [PATCH] Check if contents is set before using h5p/h5p-moodle-plugin#112 --- js/h5p.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index 4d61169..3644d37 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -692,7 +692,9 @@ H5P.getPath = function (path, contentId) { var prefix; if (contentId !== undefined) { // Check for custom override URL - prefix = H5PIntegration.contents['cid-' + contentId].contentUrl; + if (H5PIntegration.contents !== undefined) { + prefix = H5PIntegration.contents['cid-' + contentId].contentUrl; + } if (!prefix) { prefix = H5PIntegration.url + '/content/' + contentId; }