Merge pull request #4328 from vieux/fix_4298
fix divide by zero error Upstream-commit: 22861b42ee22239a1e51e5297fe6ccb96e474990 Component: engine
This commit is contained in:
@ -52,7 +52,7 @@ func (p *JSONProgress) String() string {
|
||||
}
|
||||
numbersBox = fmt.Sprintf("%8v/%v", current, total)
|
||||
|
||||
if p.Start > 0 && percentage < 50 {
|
||||
if p.Current > 0 && p.Start > 0 && percentage < 50 {
|
||||
fromStart := time.Now().UTC().Sub(time.Unix(int64(p.Start), 0))
|
||||
perEntry := fromStart / time.Duration(p.Current)
|
||||
left := time.Duration(p.Total-p.Current) * perEntry
|
||||
|
||||
Reference in New Issue
Block a user