mirror of https://github.com/matrix-org/gomatrix
Check that StateKey is not nil / null
This commit is contained in:
parent
06ec893403
commit
c7bec461cd
2
sync.go
2
sync.go
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue