Sfoglia il codice sorgente

return if message invalid

ericz 12 anni fa
parent
commit
a73540b4b1
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  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);