diff --git a/lib/server/config.js b/lib/server/config.js index a5e52807..8a9d88b1 100644 --- a/lib/server/config.js +++ b/lib/server/config.js @@ -159,21 +159,20 @@ function patch(req, res, callback) { }; pullout(req, 'string', function(error, body) { - var data = '', - json = jonny.parse(body) || {}; + var json = jonny.parse(body) || {}; if (error) - callback(error); - else - cryptoPass(json); - - data = traverse(json); + return callback(error); + + cryptoPass(json); save(function(error) { if (error) - ponse.sendError(error, options); - else - ponse.send(data, options); + return ponse.sendError(error, options); + + var data = traverse(json); + + ponse.send(data, options); }); }); }