aboutsummaryrefslogtreecommitdiff
path: root/src/errors/wrap.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors/wrap.go')
-rw-r--r--src/errors/wrap.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/errors/wrap.go b/src/errors/wrap.go
index 88ee0a9281..57060517b5 100644
--- a/src/errors/wrap.go
+++ b/src/errors/wrap.go
@@ -42,7 +42,7 @@ func Unwrap(err error) error {
// an example in the standard library. An Is method should only shallowly
// compare err and the target and not call [Unwrap] on either.
func Is(err, target error) bool {
- if target == nil {
+ if err == nil || target == nil {
return err == target
}