From: Vincent Vanwaelscappel Date: Mon, 8 Aug 2022 15:07:28 +0000 (+0200) Subject: wait #5375 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d4829bc07e97d7538e756a78abf90910c302849f;p=fluidbook-toolbox.git wait #5375 @1 --- diff --git a/resources/scorm/scorm.js b/resources/scorm/scorm.js index f1092484a..e236a6208 100644 --- a/resources/scorm/scorm.js +++ b/resources/scorm/scorm.js @@ -144,8 +144,13 @@ window.getScormLocation = function (defaultLocation) { if (currentLocation.indexOf('[') === -1 && currentLocation.indexOf('{') === -1) { // Maybe a zipped string - currentLocation = pako.inflate(base64ToBytesArr(currentLocation), {to: 'string'}) - console.log(currentLocation); + try { + currentLocation = pako.inflate(base64ToBytesArr(currentLocation), {to: 'string'}) + console.log(currentLocation); + } catch (e) { + console.warn('Unable to uncompress the data'); + currentLocation = ''; + } } if (currentLocation === undefined || currentLocation === null || currentLocation === 'null' || currentLocation === '') { res = defaultLocation; @@ -159,7 +164,7 @@ window.getScormLocation = function (defaultLocation) { } } - if (res === undefined || res === null || res === 'null') { + if (res === undefined || res === null || res === 'null' || res === '') { res = defaultLocation; } return res;