Skip to content

Commit

Permalink
fix a possible panic because of taking the address of nil
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <fp544037857@gmail.com>

Kubernetes-commit: f8a9c32a47f5d12d1baabe90a62e8637d47110d3
  • Loading branch information
Abirdcfly authored and k8s-publishing-bot committed Jul 19, 2022
1 parent 686b396 commit 37577f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/clientcmd/auth_loaders.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) {
// Prompt for user/pass and write a file if none exists.
if _, err := os.Stat(path); os.IsNotExist(err) {
authPtr, err := a.Prompt()
auth := *authPtr
if err != nil {
return nil, err
}
auth := *authPtr
data, err := json.Marshal(auth)
if err != nil {
return &auth, err
Expand Down

0 comments on commit 37577f3

Please sign in to comment.