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

Panic in routers/repo.ViewIssue() when not logged in #1539

Closed
strk opened this issue Apr 24, 2017 · 3 comments · Fixed by #1624
Closed

Panic in routers/repo.ViewIssue() when not logged in #1539

strk opened this issue Apr 24, 2017 · 3 comments · Fixed by #1624
Labels
Milestone

Comments

@strk
Copy link
Member

strk commented Apr 24, 2017

This URL serves a blank page if you are not authenticated:
https://try.gitea.io/gitea/gitea/issues/6

\cc @bkcsoft @lunny @appleboy @tboerger (someone who can check the logs?)

@bkcsoft
Copy link
Member

bkcsoft commented Apr 24, 2017

Logs:

[Macaron] PANIC: runtime error: invalid memory address or nil pointer dereference
[ ... useless internals ... ]
/srv/app/src/code.gitea.io/gitea/routers/repo/issue.go:468 (0x559181c64448)
[ ... useless internals ... ]
[Macaron] Completed /gitea/gitea/issues/1 500 Internal Server Error in 275.68255ms

Current Gitea-version: 1.1.0+137-g3012971e
Panic here:

iw, exists, err := models.GetIssueWatch(ctx.User.ID, issue.ID)

My best guess is that ctx.User isn't populated (nil) if one isn't logged in.

@bkcsoft bkcsoft changed the title blank page when not signed in on try.gitea.io Panic in routers/repo.ViewIssue() when not logged in Apr 24, 2017
@strk
Copy link
Member Author

strk commented Apr 24, 2017

Sounds like a correct analisys. So we need a testcase and after that, a fix...

@bkcsoft
Copy link
Member

bkcsoft commented Apr 24, 2017

Correction: we need a fix that includes a test-case 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants