mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
fix a possible panic because of taking the address of nil
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
This commit is contained in:
parent
f19a26a22e
commit
c8c2819a4d
@ -51,10 +51,10 @@ func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) {
|
|||||||
// Prompt for user/pass and write a file if none exists.
|
// Prompt for user/pass and write a file if none exists.
|
||||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||||
authPtr, err := a.Prompt()
|
authPtr, err := a.Prompt()
|
||||||
auth := *authPtr
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
auth := *authPtr
|
||||||
data, err := json.Marshal(auth)
|
data, err := json.Marshal(auth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &auth, err
|
return &auth, err
|
||||||
|
Loading…
Reference in New Issue
Block a user