🐛 fix client.room.name error when rename room

This commit is contained in:
WEBXOSS 2017-08-22 21:32:08 +08:00
parent 2e9178858e
commit c3990a1dbc

View file

@ -216,7 +216,7 @@ RoomManager.prototype.renameRoom = function (client,cfg) {
if (!isObj(cfg) || !isStr(cfg.roomName)) {
errMsg = 'INVALID_CONFIG';
}
var oldRoomName = client.room.name;
var oldRoomName = (client.room || {}).name || '';
var newRoomName = cfg.roomName;
if (newRoomName === oldRoomName) {
return;