Merge pull request #38455 from thaJeztah/add_errdefs_nil_check
Add missing nil-check on errdefs.Unavailable()
This commit is contained in:
commit
1930e8eb2e
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