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 {
// 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);
});