From 84ce1d53a7464f579199d653909b4c84967bcf9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Fri, 10 May 2024 22:04:08 +0200 Subject: [PATCH] fix: extra func - add nil check --- token.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/token.go b/token.go index 5bbb33217..6453fe8ba 100644 --- a/token.go +++ b/token.go @@ -99,6 +99,10 @@ func (t *Token) WithExtra(extra interface{}) *Token { // Extra fields are key-value pairs returned by the server as a // part of the token retrieval response. func (t *Token) Extra(key string) interface{} { + if t.raw == nil { + return nil + } + if raw, ok := t.raw.(map[string]interface{}); ok { return raw[key] }