summaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-08-25 00:33:23 +0100
committerGitHub <noreply@github.com>2021-08-24 19:33:23 -0400
commite891d68dd71d9f61aa51a8fbf1e5d4fd3b9d76be (patch)
tree032872de462d448aa017c0f53843bfdc50aa5ede /modules/git
parent4e761fa38584d3d9f9a607bcee806fc24d142277 (diff)
downloadgitea-e891d68dd71d9f61aa51a8fbf1e5d4fd3b9d76be.tar.gz
gitea-e891d68dd71d9f61aa51a8fbf1e5d4fd3b9d76be.zip
Prevent NPE on empty commit (#16812)
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/log_name_status.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/git/log_name_status.go b/modules/git/log_name_status.go
index 803d614d61..00a1859f7a 100644
--- a/modules/git/log_name_status.go
+++ b/modules/git/log_name_status.go
@@ -167,6 +167,9 @@ func (g *LogNameStatusRepoParser) Next(treepath string, paths2ids map[string]int
return nil, err
}
}
+ if len(g.next) == 0 {
+ return &ret, nil
+ }
if g.next[0] == '\x00' {
g.buffull = false
g.next, err = g.rd.ReadSlice('\x00')