added error check to setOnEmpty

v1.18.x
Baris Soner Usakli 11 years ago
parent 243cb5af61
commit 93292e701d

@ -62,6 +62,10 @@ var fs = require('fs'),
}, },
setOnEmpty: function (field, value, callback) { setOnEmpty: function (field, value, callback) {
Meta.configs.get(field, function (err, curValue) { Meta.configs.get(field, function (err, curValue) {
if(err) {
return callback(err);
}
if (!curValue) { if (!curValue) {
Meta.configs.set(field, value, callback); Meta.configs.set(field, value, callback);
} else { } else {

Loading…
Cancel
Save