Fix ordering of the OnReady event and Session being updated.

This commit is contained in:
Chris Rhodes 2016-04-01 18:06:20 -07:00
parent 99a1f5665a
commit 45e01b20c9

View file

@ -201,13 +201,13 @@ func (s *Session) handle(event interface{}) {
handlerParameters := []reflect.Value{reflect.ValueOf(s), reflect.ValueOf(event)}
if handlers, ok := s.handlers[reflect.TypeOf(event)]; ok {
if handlers, ok := s.handlers[nil]; ok {
for _, handler := range handlers {
handler.Call(handlerParameters)
}
}
if handlers, ok := s.handlers[nil]; ok {
if handlers, ok := s.handlers[reflect.TypeOf(event)]; ok {
for _, handler := range handlers {
handler.Call(handlerParameters)
}