Skip to content

Commit

Permalink
Catching thrown exception now
Browse files Browse the repository at this point in the history
  • Loading branch information
rmeissn committed Feb 5, 2018
1 parent f131a4f commit 96e3323
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ io.on('connection', (socket) => {
if(room !== socket.id && Object.keys(availableRooms[room].sockets).includes(socket.id) && availableRooms[room].length === 1){
Object.keys(rooms).forEach((deckID) => {
if(rooms[deckID].some((room2) => room2.roomName === room)) {
rooms[deckID].find((x) => x.roomName === room).twitterStream.destroy();//close twitter stream
try {
rooms[deckID].find((x) => x.roomName === room).twitterStream.destroy();//close twitter stream
} catch (e) {return;}
rooms[deckID] = rooms[deckID].filter((x) => x.roomName !== room);//remove from array
if(rooms[deckID].length === 0)
delete rooms[deckID];
Expand Down

0 comments on commit 96e3323

Please sign in to comment.