Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
dont call progress callback if it doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Mar 21, 2018
1 parent 887e143 commit 8927638
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ func copyWithProgress(to io.Writer, from io.Reader, cb func(int64) int64) error
for {
n, err := from.Read(buf)
if n != 0 {
cb(int64(n))
if cb != nil {
cb(int64(n))
}
_, err2 := to.Write(buf[:n])
if err2 != nil {
return err2
Expand Down

0 comments on commit 8927638

Please sign in to comment.