Skip to content

Commit 37577f3

Browse files
Abirdcflyk8s-publishing-bot
authored andcommitted
fix a possible panic because of taking the address of nil
Signed-off-by: Abirdcfly <[email protected]> Kubernetes-commit: f8a9c32a47f5d12d1baabe90a62e8637d47110d3
1 parent 686b396 commit 37577f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/clientcmd/auth_loaders.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) {
5151
// Prompt for user/pass and write a file if none exists.
5252
if _, err := os.Stat(path); os.IsNotExist(err) {
5353
authPtr, err := a.Prompt()
54-
auth := *authPtr
5554
if err != nil {
5655
return nil, err
5756
}
57+
auth := *authPtr
5858
data, err := json.Marshal(auth)
5959
if err != nil {
6060
return &auth, err

0 commit comments

Comments
 (0)