more err checks

v1.18.x
barisusakli 10 years ago
parent 18462c4190
commit 9909f8ba79

@ -137,6 +137,9 @@ accountsController.getUserByUID = function(req, res, next) {
var uid = req.params.uid ? req.params.uid : 0; var uid = req.params.uid ? req.params.uid : 0;
user.getUserData(uid, function(err, userData) { user.getUserData(uid, function(err, userData) {
if (err) {
return next(err);
}
res.json(userData); res.json(userData);
}); });
}; };

@ -5,11 +5,14 @@ var groups = require('../groups'),
nconf = require('nconf'), nconf = require('nconf'),
groupsController = {}; groupsController = {};
groupsController.list = function(req, res) { groupsController.list = function(req, res, next) {
groups.list({ groups.list({
truncateUserList: true, truncateUserList: true,
expand: true expand: true
}, function(err, groups) { }, function(err, groups) {
if (err) {
return next(err);
}
res.render('groups/list', { res.render('groups/list', {
groups: groups groups: groups
}); });

Loading…
Cancel
Save