瀏覽代碼

Always handle the raw event.

Chris Rhodes 8 年之前
父節點
當前提交
4d4f8f7741
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      wsapi.go

+ 6 - 3
wsapi.go

@@ -290,15 +290,18 @@ func (s *Session) event(messageType int, message []byte) {
 			log.Println("Unable to unmarshal event data.", err)
 			// Ready events must fire, even if they are empty.
 			if e.Type != "READY" {
-				i = e
+				i = nil
 			}
 		}
 	} else {
 		log.Println("Unknown event.")
-		i = e
+		i = nil
 	}
 
-	s.handle(i)
+	if i != nil {
+		s.handle(i)
+	}
+	s.handle(e)
 
 	return
 }