Error check to prevent exception from Cipher
authorDavid Banham <david@banham.id.au>
Sun, 10 Mar 2013 22:15:11 +0000 (09:15 +1100)
committerDavid Banham <david@banham.id.au>
Sun, 10 Mar 2013 22:25:26 +0000 (09:25 +1100)
plugin/multiplex/index.js

index 0b03fc7c6b62b6f1a78cb19195c22f3932f7f6af..35df8e3919b6361152798f46b36ef3fa2c58aca8 100644 (file)
@@ -15,6 +15,7 @@ var opts = {
 
 io.sockets.on('connection', function(socket) {
        socket.on('slidechanged', function(slideData) {
+               if (typeof slideData.secret == 'undefined' || slideData.secret == null || slideData.secret === '') return;
                if (createHash(slideData.secret) === slideData.socketId) {
                        slideData.secret = null;
                        socket.broadcast.emit(slideData.socketId, slideData);