Check that the returned resources before referencing them (#2612)

This commit is contained in:
Todd committed 2022-11-14 13:23:56 -08:00
1 parent 4509981e5b
commit 426e6aaa79
4 files changed
+171 -21

No files matched your search

+2 -2
View File
@@ -230,9 +230,9 @@ func Callback(
return "", errors.Wrap(ctx, err, op)
}
scope, err := iamRepo.LookupScope(ctx, am.ScopeId)
_, err = iamRepo.LookupScope(ctx, am.ScopeId)
if err != nil {
return "", errors.Wrap(ctx, err, op, errors.WithMsg("unable to lookup account scope: "+scope.PublicId))
return "", errors.Wrap(ctx, err, op, errors.WithMsg("unable to lookup account scope: "+am.ScopeId))
}
user, err := iamRepo.LookupUserWithLogin(ctx, acct.PublicId)