Explorar el Código

return if message invalid

ericz hace 12 años
padre
commit
a73540b4b1
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      lib/socket.js

+ 1 - 0
lib/socket.js

@@ -117,6 +117,7 @@ Socket.prototype._setHTTPTimeout = function() {
 Socket.prototype.send = function(data) {
   if (!data.type) {
     this.emit('error', 'Invalid message');
+    return;
   }
   
   message = JSON.stringify(data);