Skip to content

Commit ef76bd7

Browse files
committed
progress: add protection for render context cancel
1 parent 09a9580 commit ef76bd7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

progress/render.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,11 @@ func (p *Progress) renderTrackers(lastRenderLength int) int {
388388

389389
// stop if auto stop is enabled and there are no more active trackers
390390
if p.autoStop && p.LengthActive() == 0 {
391-
p.renderContextCancel()
391+
p.renderContextCancelMutex.Lock()
392+
if p.renderContextCancel != nil {
393+
p.renderContextCancel()
394+
}
395+
p.renderContextCancelMutex.Unlock()
392396
}
393397

394398
return out.Len()

0 commit comments

Comments
 (0)