Codebase list golang-github-vbauerster-mpb / c1b0857
check for nil decorator before wrap Vladimir Bauer 4 years ago
2 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
88 // `message` message to display on abort event
99 //
1010 func OnAbort(decorator Decorator, message string) Decorator {
11 if decorator == nil {
12 return nil
13 }
1114 d := &onAbortWrapper{
1215 Decorator: decorator,
1316 msg: message,
77 // `message` message to display on complete event
88 //
99 func OnComplete(decorator Decorator, message string) Decorator {
10 if decorator == nil {
11 return nil
12 }
1013 d := &onCompleteWrapper{
1114 Decorator: decorator,
1215 msg: message,