send back empty object if no data for user

v1.18.x
Baris Usakli 12 years ago
parent b1e369f1fc
commit 41aeee9839

@ -246,11 +246,12 @@
});
socket.on('chatMessage', function(data){
socket.on('chatMessage', function(data) {
var username = data.username;
var fromuid = data.fromuid;
var message = data.message;
require(['chat'], function(chat) {
var chatModal = chat.createModalIfDoesntExist(username, fromuid);
chatModal.show();

@ -64,11 +64,15 @@ var utils = require('./../public/src/utils.js'),
RDB.hgetall('user:'+uid, function(err, data){
if(err === null)
{
if(data && data['password'])
if(data) {
if(data['password'])
delete data['password'];
data.uid = uid;
callback(data);
}
else
callback({});
}
else
console.log(err);
});

Loading…
Cancel
Save