Kaynağa Gözat

return if message invalid

ericz 12 yıl önce
ebeveyn
işleme
a73540b4b1
1 değiştirilmiş dosya ile 1 ekleme ve 0 silme
  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);