added check for valid field

v1.18.x
Baris Soner Usakli 11 years ago
parent 32adbc8c77
commit 4273fc4d23

@ -44,6 +44,10 @@ var fs = require('fs'),
db.getObjectFields('config', fields, callback); db.getObjectFields('config', fields, callback);
}, },
set: function (field, value, callback) { set: function (field, value, callback) {
if(!field) {
return callback(new Error('invalid config field'));
}
db.setObjectField('config', field, value, function(err, res) { db.setObjectField('config', field, value, function(err, res) {
if (callback) { if (callback) {
if(!err && Meta.config) { if(!err && Meta.config) {

Loading…
Cancel
Save