Skip to content

Commit

Permalink
only write if the filechunk has len > 0. (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav committed Nov 6, 2022
1 parent e8cd2e7 commit 2898303
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/handlers/archive.go
Expand Up @@ -155,7 +155,9 @@ func (d *Archive) ReadToMax(reader io.Reader) ([]byte, error) {
return []byte{}, err
}
d.size += bRead
fileContent.Write(fileChunk[0:bRead])
if len(fileChunk) > 0 {
fileContent.Write(fileChunk[0:bRead])
}
if bRead < 512 {
break
}
Expand Down

0 comments on commit 2898303

Please sign in to comment.