diff --git a/gothic/gothic.go b/gothic/gothic.go
index <HASH>..<HASH> 100644
--- a/gothic/gothic.go
+++ b/gothic/gothic.go
@@ -247,8 +247,8 @@ func getProviderName(req *http.Request) (string, error) {
 	}
 
 	//  try to get it from the go-context's value of "provider" key
-	if p := req.Context().Value("provider"); p != nil {
-		return p.(string), nil
+	if p, ok := req.Context().Value("provider").(string); ok {
+		return p, nil
 	}
 
 	// if not found then return an empty string with the corresponding error
string conversion in p,ok style to prevent panic if value of returned provder is not string