diff --git a/bar_option.go b/bar_option.go index 64d2e18..b39628f 100644 --- a/bar_option.go +++ b/bar_option.go @@ -114,6 +114,9 @@ if filler == nil { return nil } + if f, ok := filler.(BarFillerFunc); ok && f == nil { + return nil + } fn := makeExtenderFunc(filler, rev) return func(s *bState) { s.extender = fn diff --git a/progress.go b/progress.go index 42351a5..bbff7db 100644 --- a/progress.go +++ b/progress.go @@ -149,6 +149,8 @@ // `(nil, DoneError)` is returned. func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) (*Bar, error) { if filler == nil { + filler = NopStyle().Build() + } else if f, ok := filler.(BarFillerFunc); ok && f == nil { filler = NopStyle().Build() } ch := make(chan *Bar)