Przeglądaj źródła

Merge pull request #156 from iopred/develop

BREAKING -- Always handle the raw event.
Bruce 8 lat temu
rodzic
commit
5af297183e
1 zmienionych plików z 6 dodań i 3 usunięć
  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
 }