fix: copy progress crash (#4596)

Fix naked type assertion crash on `mc cp` with no output.

Fixes #4595
This commit is contained in:
Klaus Post
2023-06-12 13:48:33 -07:00
committed by GitHub
parent 5e4ab1ec48
commit 2ecd33086f
+5 -3
View File
@@ -554,9 +554,11 @@ func doCopySession(ctx context.Context, cancelCopy context.CancelFunc, cli *cli.
} else {
// Print the copy resume summary once in start
if startContinue && cli.Bool("continue") {
startSize := humanize.IBytes(uint64(pg.(*progressBar).Start().Get()))
totalSize := humanize.IBytes(uint64(pg.(*progressBar).Total))
console.Println("Resuming copy from ", startSize, " / ", totalSize)
if pb, ok := pg.(*progressBar); ok {
startSize := humanize.IBytes(uint64(pb.Start().Get()))
totalSize := humanize.IBytes(uint64(pb.Total))
console.Println("Resuming copy from ", startSize, " / ", totalSize)
}
startContinue = false
}
parallel.queueTask(func() URLs {