Codebase list golang-github-vbauerster-mpb / a4b4b53
check for nil BarFillerFunc where BarFiller is expected Vladimir Bauer 1 year, 10 months ago
2 changed file(s) with 5 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
113113 if filler == nil {
114114 return nil
115115 }
116 if f, ok := filler.(BarFillerFunc); ok && f == nil {
117 return nil
118 }
116119 fn := makeExtenderFunc(filler, rev)
117120 return func(s *bState) {
118121 s.extender = fn
148148 // `(nil, DoneError)` is returned.
149149 func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) (*Bar, error) {
150150 if filler == nil {
151 filler = NopStyle().Build()
152 } else if f, ok := filler.(BarFillerFunc); ok && f == nil {
151153 filler = NopStyle().Build()
152154 }
153155 ch := make(chan *Bar)