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},