Handle cases where a field don't have params

semantics-font
Svein-Tore Griff With 2015-04-14 14:01:28 +02:00
parent 80a80aef7a
commit 09c6d5c4f8
1 changed files with 3 additions and 1 deletions

View File

@ -193,12 +193,14 @@ H5P.ContentUpgradeProcess = (function (Version) {
else { else {
// Go through all fields in the group // Go through all fields in the group
asyncSerial(field.fields, function (index, subField, next) { 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) { if (upgradedParams) {
params[subField.name] = upgradedParams; params[subField.name] = upgradedParams;
} }
next(err); next(err);
}); });
}, function (err) { }, function (err) {
done(err, params); done(err, params);
}); });