Add check to avoid crashes when a claim element's value is nil
This commit is contained in:
parent
cdaed2f4e4
commit
3e92caf52f
1 changed files with 6 additions and 0 deletions
|
@ -450,6 +450,12 @@ func (h *ConsentHandler) mapRequestedClaims(
|
|||
for _, claimElement := range []*models.ClaimElement{claims.GetUserInfo(), claims.GetIDToken()} {
|
||||
if claimElement != nil {
|
||||
for k, v := range *claimElement {
|
||||
if v == nil {
|
||||
h.logger.Warn("claim element is nil", "key", k)
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
if _, ok := supportedClaims[k]; !ok {
|
||||
h.logger.Warn("ignoring unsupported claim", "claim", k)
|
||||
|
||||
|
|
Loading…
Reference in a new issue