Fix Commits nil pointer dereference - #2203
Merged
Merged
Conversation
Contributor
|
LGTM |
Member
|
LGTM |
Member
|
There is no commit? We cannot simply return an 404 and as an error but a page. |
Member
Author
|
@lunny What do you mean? I don't get it |
lunny
reviewed
Jul 26, 2017
| func Commits(ctx *context.Context) { | ||
| ctx.Data["PageIsCommits"] = true | ||
| if ctx.Repo.Commit == nil { | ||
| ctx.Handle(404, "Commit not found", nil) |
Member
There was a problem hiding this comment.
If ctx.Repo.Commit == nil, is that an error? Why return 404?
Member
Author
There was a problem hiding this comment.
I think so, somehow my repo got corrupt and some commits are gone.
Resulting in ctx.Repo.Commit == nil
Member
|
@lunny are you ok with this? |
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.