From 26d0a3a341115bf74ec6f68fb6715a654f51d1ad Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 6 Feb 2017 14:39:59 +0100 Subject: [PATCH] Double check that contents settings exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … before using them. HFP-714 --- js/h5p.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index e4d0138..6a28573 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -661,7 +661,8 @@ H5P.getPath = function (path, contentId) { var prefix; if (contentId !== undefined) { // Check for custom override URL - if (H5PIntegration.contents !== undefined) { + if (H5PIntegration.contents !== undefined && + H5PIntegration.contents['cid-' + contentId]) { prefix = H5PIntegration.contents['cid-' + contentId].contentUrl; } if (!prefix) {