Add error logging for missing data
This commit is contained in:
parent
908221416e
commit
4bab42478f
|
@ -773,6 +773,10 @@ DataModel.createUpdates = function(deltas, cb) {
|
||||||
tasks.push(function(cb) {
|
tasks.push(function(cb) {
|
||||||
Model.findById(change.modelId, function(err, inst) {
|
Model.findById(change.modelId, function(err, inst) {
|
||||||
if(err) return cb(err);
|
if(err) return cb(err);
|
||||||
|
if(!inst) {
|
||||||
|
console.error('missing data for change:', change);
|
||||||
|
return callback();
|
||||||
|
}
|
||||||
if(inst.toObject) {
|
if(inst.toObject) {
|
||||||
update.data = inst.toObject();
|
update.data = inst.toObject();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue