diff --git a/syncapi/types/types.go b/syncapi/types/types.go index 3cbf0f4e7..cc78c7eb7 100644 --- a/syncapi/types/types.go +++ b/syncapi/types/types.go @@ -260,7 +260,7 @@ func NewInviteResponse(ev gomatrixserverlib.HeaderedEvent) *InviteResponse { if err := json.Unmarshal(ev.Unsigned(), &unsigned); err == nil { res.InviteState.Events = unsigned.InviteRoomState } - if res.InviteState.Events == nil { + if len(res.InviteState.Events) == 0 || res.InviteState.Events == nil { res.InviteState.Events = json.RawMessage{'[', ']'} } return &res