Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md in npm package cause gitea to crash #23082

Closed
nmqh opened this issue Feb 23, 2023 · 1 comment · Fixed by #23092
Closed

README.md in npm package cause gitea to crash #23082

nmqh opened this issue Feb 23, 2023 · 1 comment · Fixed by #23092
Assignees
Milestone

Comments

@nmqh
Copy link

nmqh commented Feb 23, 2023

Description

After the attached file README.md is included in a npm package and published to GITea, and then when package details page is opened in GITea site for this package, GITea crashes (see attached error message) AppErrorAndCrash

In the README.md if the following line is removed and published, the gitea app/service does not fail when viewing the package details in GITea.
- The pacakge name @qccat-ui has been renamed to @qccat/core-ui.

Gitea Version

1.18.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

GITea is running in windows.

Database

None

@nmqh nmqh added the type/bug label Feb 23, 2023
@Zettat123
Copy link
Contributor

Zettat123 commented Feb 23, 2023

I think the reason of the panic is the ctx.Ctx is nil

if processorHelper.IsUsernameMentionable != nil && processorHelper.IsUsernameMentionable(ctx.Ctx, mentionedUsername) {

ctx.Ctx should be set when create markup.RenderContext

"RenderMarkdownToHtml": func(input string) template.HTML {
output, err := markdown.RenderString(&markup.RenderContext{
URLPrefix: setting.AppSubURL,
}, input)

@Zettat123 Zettat123 self-assigned this Feb 23, 2023
@lunny lunny added this to the 1.19.0 milestone Feb 23, 2023
lunny added a commit that referenced this issue Feb 24, 2023
Fix #23082.

This bug is caused by a nil context in
#23082 (comment) .

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
yardenshoham pushed a commit to yardenshoham/gitea that referenced this issue Feb 24, 2023
Fix go-gitea#23082.

This bug is caused by a nil context in
go-gitea#23082 (comment) .

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
lunny added a commit that referenced this issue Feb 24, 2023
Backport #23092

Fix #23082.

This bug is caused by a nil context in
#23082 (comment) .

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants