Skip to content

Fix Commits nil pointer dereference - #2203

Merged
lunny merged 1 commit into
go-gitea:masterfrom
Bwko:fix_panic
Jul 31, 2017
Merged

Fix Commits nil pointer dereference#2203
lunny merged 1 commit into
go-gitea:masterfrom
Bwko:fix_panic

Conversation

@Bwko

@Bwko Bwko commented Jul 23, 2017

Copy link
Copy Markdown
Member

No description provided.

@andreynering

Copy link
Copy Markdown
Contributor

LGTM

@lafriks lafriks added type/bug lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 23, 2017
@lafriks lafriks added this to the 1.2.0 milestone Jul 23, 2017
@ethantkoenig

Copy link
Copy Markdown
Member

LGTM

@lafriks lafriks added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 23, 2017
@lunny

lunny commented Jul 26, 2017

Copy link
Copy Markdown
Member

There is no commit? We cannot simply return an 404 and as an error but a page.

@Bwko

Bwko commented Jul 26, 2017

Copy link
Copy Markdown
Member Author

@lunny What do you mean? I don't get it

Comment thread routers/repo/commit.go
func Commits(ctx *context.Context) {
ctx.Data["PageIsCommits"] = true
if ctx.Repo.Commit == nil {
ctx.Handle(404, "Commit not found", nil)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ctx.Repo.Commit == nil, is that an error? Why return 404?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, somehow my repo got corrupt and some commits are gone.
Resulting in ctx.Repo.Commit == nil

@lafriks

lafriks commented Jul 30, 2017

Copy link
Copy Markdown
Member

@lunny are you ok with this?

@lunny
lunny merged commit 1193627 into go-gitea:master Jul 31, 2017
@Bwko
Bwko deleted the fix_panic branch July 31, 2017 08:57
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Feb 26, 2024
- Fix typo in the slow query threshold setting, add a deprecation warning.
- Resolves go-gitea#2203

(cherry picked from commit 02f6608e5fc21a0a00da5fc4c99152d43ee2ea4d)
(cherry picked from commit 4e8f6b2ffdb25e0257933ee0a1bd21e3f4e86740)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants