catch server error when id or obj is not set

This commit is contained in:
cracker0dks 2019-06-02 17:38:14 +02:00
parent b0a9447cdb
commit 9ab207faa0

View File

@ -122,7 +122,9 @@ io.on('connection', function (socket) {
var whiteboardId = null;
socket.on('disconnect', function () {
delete smallestScreenResolutions[whiteboardId][socket.id];
if(smallestScreenResolutions && smallestScreenResolutions[whiteboardId] && socket && socket.id) {
delete smallestScreenResolutions[whiteboardId][socket.id];
}
socket.broadcast.emit('refreshUserBadges', null); //Removes old user Badges
sendSmallestScreenResolution();
});