1
0
Fork 0

Prevent NPE on empty commit (#16812)

This commit is contained in:
zeripath 2021-08-25 00:33:23 +01:00 committed by GitHub
parent 4e761fa385
commit e891d68dd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,6 +167,9 @@ func (g *LogNameStatusRepoParser) Next(treepath string, paths2ids map[string]int
return nil, err return nil, err
} }
} }
if len(g.next) == 0 {
return &ret, nil
}
if g.next[0] == '\x00' { if g.next[0] == '\x00' {
g.buffull = false g.buffull = false
g.next, err = g.rd.ReadSlice('\x00') g.next, err = g.rd.ReadSlice('\x00')