mirror of
https://gitee.com/gitea/gitea
synced 2025-11-12 12:30:25 +08:00
* use e if it is an option * potential nil so check err first * check err first * m == nil already checked
This commit is contained in:
@@ -237,11 +237,11 @@ func Diff(ctx *context.Context) {
|
||||
parents := make([]string, commit.ParentCount())
|
||||
for i := 0; i < commit.ParentCount(); i++ {
|
||||
sha, err := commit.ParentID(i)
|
||||
parents[i] = sha.String()
|
||||
if err != nil {
|
||||
ctx.NotFound("repo.Diff", err)
|
||||
return
|
||||
}
|
||||
parents[i] = sha.String()
|
||||
}
|
||||
|
||||
ctx.Data["CommitID"] = commitID
|
||||
|
||||
Reference in New Issue
Block a user