Fix accessing nil map (#1996)
Co-authored-by: julien.demais.e <julien.demais.e@thalesdigital.io>mine
parent
ab9f960788
commit
2955e2251f
|
|
@ -54,6 +54,9 @@ func (k *K9s) CurrentContextDir() string {
|
|||
|
||||
// ActivateCluster initializes the active cluster is not present.
|
||||
func (k *K9s) ActivateCluster(ns string) {
|
||||
if k.Clusters == nil {
|
||||
k.Clusters = map[string]*Cluster{}
|
||||
}
|
||||
if _, ok := k.Clusters[k.CurrentCluster]; ok {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue