check err first

v1.18.x
barisusakli 10 years ago
parent fc4e7c0fff
commit c3b8d0b328

@ -20,14 +20,16 @@ module.exports = function(Meta) {
Meta.settings.set = function(hash, values, callback) { Meta.settings.set = function(hash, values, callback) {
var key = 'settings:' + hash; var key = 'settings:' + hash;
db.setObject(key, values, function(err) { db.setObject(key, values, function(err) {
if (!err) { if (err) {
plugins.fireHook('action:settings.set', { return callback(err);
plugin: hash,
settings: values
});
} }
callback.apply(this, arguments); plugins.fireHook('action:settings.set', {
plugin: hash,
settings: values
});
callback();
}); });
}; };

Loading…
Cancel
Save