Add check to avoid crashes when a claim element's value is nil

This commit is contained in:
Jan Dittberner 2024-08-16 18:05:08 +02:00
parent cdaed2f4e4
commit 3e92caf52f

View file

@ -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)