Check that StateKey is not nil / null

This commit is contained in:
Richard Lewis 2017-04-20 21:29:44 +01:00
parent 06ec893403
commit c7bec461cd
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ func (s *DefaultSyncer) shouldProcessResponse(resp *RespSync, since string) bool
for roomID, roomData := range resp.Rooms.Join { for roomID, roomData := range resp.Rooms.Join {
for i := len(roomData.Timeline.Events) - 1; i >= 0; i-- { for i := len(roomData.Timeline.Events) - 1; i >= 0; i-- {
e := roomData.Timeline.Events[i] e := roomData.Timeline.Events[i]
if e.Type == "m.room.member" && *e.StateKey == s.UserID { if e.Type == "m.room.member" && e.StateKey != nil && *e.StateKey == s.UserID {
m := e.Content["membership"] m := e.Content["membership"]
mship, ok := m.(string) mship, ok := m.(string)
if !ok { if !ok {