From 3d4310f5b74cd8d176c017c8d1c99e9d4c223ec7 Mon Sep 17 00:00:00 2001 From: luojielin Date: Mon, 3 Jul 2023 13:53:37 +0800 Subject: [PATCH] fix: fix IntrospectToken might null pointer --- authentication/authentication_client.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/authentication/authentication_client.go b/authentication/authentication_client.go index 869c84f..25f2b77 100644 --- a/authentication/authentication_client.go +++ b/authentication/authentication_client.go @@ -362,8 +362,14 @@ func (client *AuthenticationClient) IntrospectToken(token string) (*dto.TokenInt Headers: client.getReqHeaders(header), ReqDto: body, }) - println(string(resp.Body)) + var response dto.TokenIntrospectResponse + + if resp == nil || resp.Body == nil { + return &response, err + } + println(string(resp.Body)) + if err != nil { return nil, err }