mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add missing nil-check on errdefs.Unavailable()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
f76d6a078d
commit
43a8ec654b
1 changed files with 3 additions and 0 deletions
|
@ -76,6 +76,9 @@ func (e errUnavailable) Cause() error {
|
|||
|
||||
// Unavailable is a helper to create an error of the class with the same name from any error type
|
||||
func Unavailable(err error) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
return errUnavailable{err}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue