From c7bec461cded824c8ff93d4efbc4b9af2e681fbb Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Thu, 20 Apr 2017 21:29:44 +0100 Subject: [PATCH] Check that StateKey is not nil / null --- sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync.go b/sync.go index 356d430..c4bea48 100644 --- a/sync.go +++ b/sync.go @@ -112,7 +112,7 @@ func (s *DefaultSyncer) shouldProcessResponse(resp *RespSync, since string) bool for roomID, roomData := range resp.Rooms.Join { for i := len(roomData.Timeline.Events) - 1; i >= 0; 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"] mship, ok := m.(string) if !ok {