diff --git a/js/h5p-content-upgrade-process.js b/js/h5p-content-upgrade-process.js index 6954622..cab1dfd 100644 --- a/js/h5p-content-upgrade-process.js +++ b/js/h5p-content-upgrade-process.js @@ -54,6 +54,12 @@ H5P.ContentUpgradeProcess = (function (Version) { if (err) { return done(err); } + if (library.semantics === null) { + return done({ + type: 'libraryMissing', + library: library.name + ' ' + library.version.major + '.' + library.version.minor + }); + } // Run upgrade routines on params self.processParams(library, oldVersion, newVersion, params, metadata, function (err, params, metadata) { diff --git a/js/h5p-content-upgrade.js b/js/h5p-content-upgrade.js index 168c694..9dc066c 100644 --- a/js/h5p-content-upgrade.js +++ b/js/h5p-content-upgrade.js @@ -422,6 +422,10 @@ error = info.errorContent.replace('%id', error.id) + ' ' + info.errorParamsBroken; break; + case 'libraryMissing': + error = info.errorLibrary.replace('%lib', error.library); + break; + case 'scriptMissing': error = info.errorScript.replace('%lib', error.library); break;