From d4829bc07e97d7538e756a78abf90910c302849f Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 8 Aug 2022 17:07:28 +0200 Subject: [PATCH] wait #5375 @1 --- resources/scorm/scorm.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; -- 2.39.5