mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Add missing nil-check on errdefs.Unavailable()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -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}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user