Fix one case of phantom viewers

This commit is contained in:
yflory 2019-01-30 15:49:07 +01:00
parent 7e00d444c0
commit d989b6d6e4

View File

@ -205,12 +205,14 @@ define([
} }
} }
var oldChannel = ctx.clients[clientId].channel; if (ctx.clients[clientId]) {
var oldChan = ctx.channels[oldChannel]; var oldChannel = ctx.clients[clientId].channel;
if (oldChan) { var oldChan = ctx.channels[oldChannel];
ctx.emit('LEAVE', {id: clientId}, [oldChan.clients[0]]); if (oldChan) {
ctx.emit('LEAVE', {id: clientId}, [oldChan.clients[0]]);
}
delete ctx.clients[clientId];
} }
delete ctx.clients[clientId];
}; };