* 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:
parent
c6b78c3d31
commit
11300ee582
6 changed files with 13 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue