diff --git a/src/meta/settings.js b/src/meta/settings.js index 95661a6dbe..10c987f108 100644 --- a/src/meta/settings.js +++ b/src/meta/settings.js @@ -20,14 +20,16 @@ module.exports = function(Meta) { Meta.settings.set = function(hash, values, callback) { var key = 'settings:' + hash; db.setObject(key, values, function(err) { - if (!err) { - plugins.fireHook('action:settings.set', { - plugin: hash, - settings: values - }); + if (err) { + return callback(err); } - callback.apply(this, arguments); + plugins.fireHook('action:settings.set', { + plugin: hash, + settings: values + }); + + callback(); }); };