From 09c6d5c4f8ad305c787a9c2208a0501b32c2304e Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Tue, 14 Apr 2015 14:01:28 +0200 Subject: [PATCH] Handle cases where a field don't have params --- js/h5p-content-upgrade-process.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/h5p-content-upgrade-process.js b/js/h5p-content-upgrade-process.js index e86a66a..94a6809 100644 --- a/js/h5p-content-upgrade-process.js +++ b/js/h5p-content-upgrade-process.js @@ -193,12 +193,14 @@ H5P.ContentUpgradeProcess = (function (Version) { else { // Go through all fields in the group asyncSerial(field.fields, function (index, subField, next) { - self.processField(subField, params[subField.name], function (err, upgradedParams) { + var paramsToProcess = params ? params[subField.name] : null; + self.processField(subField, paramsToProcess, function (err, upgradedParams) { if (upgradedParams) { params[subField.name] = upgradedParams; } next(err); }); + }, function (err) { done(err, params); });