From fa618e76b6a81337ebe99060ababc8d98e6357ef Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 22 Apr 2020 17:39:07 +0100 Subject: [PATCH] Really don't send nulls for invite state --- syncapi/types/types.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syncapi/types/types.go b/syncapi/types/types.go index e0c3ee4f8..3cbf0f4e7 100644 --- a/syncapi/types/types.go +++ b/syncapi/types/types.go @@ -254,13 +254,15 @@ type InviteResponse struct { // NewInviteResponse creates an empty response with initialised arrays. func NewInviteResponse(ev gomatrixserverlib.HeaderedEvent) *InviteResponse { res := InviteResponse{} - res.InviteState.Events = json.RawMessage{'[', ']'} var unsigned struct { InviteRoomState json.RawMessage `json:"invite_room_state"` } if err := json.Unmarshal(ev.Unsigned(), &unsigned); err == nil { res.InviteState.Events = unsigned.InviteRoomState } + if res.InviteState.Events == nil { + res.InviteState.Events = json.RawMessage{'[', ']'} + } return &res }