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();

@ -42,7 +42,7 @@ var utils = require('./../public/src/utils.js'),
}
var uuids = uids.filter(function(value, index, self) {
return self.indexOf(value) === index;
return self.indexOf(value) === index;
});
var data = {},
@ -64,10 +64,14 @@ var utils = require('./../public/src/utils.js'),
RDB.hgetall('user:'+uid, function(err, data){
if(err === null)
{
if(data && data['password'])
delete data['password'];
data.uid = uid;
callback(data);
if(data) {
if(data['password'])
delete data['password'];
data.uid = uid;
callback(data);
}
else
callback({});
}
else
console.log(err);

Loading…
Cancel
Save