From 65ff5c9a2c0b81cb9c6df6fb6e27418577eb1160 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 18 Dec 2020 13:33:08 +0000 Subject: [PATCH] Don't send null in joined_rooms response (#1659) --- clientapi/routing/memberships.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clientapi/routing/memberships.go b/clientapi/routing/memberships.go index 513fcefd7..6ddcf1be3 100644 --- a/clientapi/routing/memberships.go +++ b/clientapi/routing/memberships.go @@ -111,6 +111,9 @@ func GetJoinedRooms( util.GetLogger(req.Context()).WithError(err).Error("QueryRoomsForUser failed") return jsonerror.InternalServerError() } + if res.RoomIDs == nil { + res.RoomIDs = []string{} + } return util.JSONResponse{ Code: http.StatusOK, JSON: getJoinedRoomsResponse{res.RoomIDs},