Skip to content

Commit e891d68

Browse files
authored
Prevent NPE on empty commit (#16812)
1 parent 4e761fa commit e891d68

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/git/log_name_status.go

+3
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ func (g *LogNameStatusRepoParser) Next(treepath string, paths2ids map[string]int
167167
return nil, err
168168
}
169169
}
170+
if len(g.next) == 0 {
171+
return &ret, nil
172+
}
170173
if g.next[0] == '\x00' {
171174
g.buffull = false
172175
g.next, err = g.rd.ReadSlice('\x00')

0 commit comments

Comments
 (0)