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

Closed
opened 2025-11-02 03:32:18 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @strk on GitHub (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?)

Originally created by @strk on GitHub (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?)
GiteaMirror added the type/bug label 2025-11-02 03:32:18 -06:00
Author
Owner

@bkcsoft commented on GitHub (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: 3012971e92/routers/repo/issue.go (L468)

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

@bkcsoft commented on GitHub (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: https://github.com/go-gitea/gitea/blob/3012971e92b79683178a286511c091fb31ee90f6/routers/repo/issue.go#L468 My best guess is that `ctx.User` isn't populated (`nil`) if one isn't logged in.
Author
Owner

@strk commented on GitHub (Apr 24, 2017):

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

@strk commented on GitHub (Apr 24, 2017): Sounds like a correct analisys. So we need a testcase and *after* that, a fix...
Author
Owner

@bkcsoft commented on GitHub (Apr 24, 2017):

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

@bkcsoft commented on GitHub (Apr 24, 2017): Correction: we need a fix that _includes_ a test-case 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#664