check for nil decorator before wrap
Vladimir Bauer
4 years ago
| 8 | 8 |
// `message` message to display on abort event
|
| 9 | 9 |
//
|
| 10 | 10 |
func OnAbort(decorator Decorator, message string) Decorator {
|
|
11 |
if decorator == nil {
|
|
12 |
return nil
|
|
13 |
}
|
| 11 | 14 |
d := &onAbortWrapper{
|
| 12 | 15 |
Decorator: decorator,
|
| 13 | 16 |
msg: message,
|
| 7 | 7 |
// `message` message to display on complete event
|
| 8 | 8 |
//
|
| 9 | 9 |
func OnComplete(decorator Decorator, message string) Decorator {
|
|
10 |
if decorator == nil {
|
|
11 |
return nil
|
|
12 |
}
|
| 10 | 13 |
d := &onCompleteWrapper{
|
| 11 | 14 |
Decorator: decorator,
|
| 12 | 15 |
msg: message,
|