mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
Fix unhandled callback errors
This commit is contained in:
@@ -79,6 +79,10 @@ define('admin/settings/email', ['admin/settings'], function(settings) {
|
||||
}
|
||||
|
||||
socket.emit('meta.getServerTime', {}, function(err, now) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
now = new Date(now);
|
||||
|
||||
$('#serverTime').text(now.toString());
|
||||
|
||||
@@ -381,7 +381,9 @@ authenticationController.localLogin = function(req, username, password, next) {
|
||||
if (result.banned) {
|
||||
// Retrieve ban reason and show error
|
||||
return user.getLatestBanInfo(uid, function(err, banInfo) {
|
||||
if (banInfo.reason) {
|
||||
if (err) {
|
||||
next(err);
|
||||
} else if (banInfo.reason) {
|
||||
next(new Error('[[error:user-banned-reason, ' + banInfo.reason + ']]'));
|
||||
} else {
|
||||
next(new Error('[[error:user-banned]]'));
|
||||
|
||||
Reference in New Issue
Block a user