Skip to content

Commit

Permalink
fix panic (#27)
Browse files Browse the repository at this point in the history
Signed-off-by: l1b0k <libokang.dev@gmail.com>
  • Loading branch information
l1b0k committed Jan 4, 2021
1 parent 85972a3 commit 25a00c0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,14 @@ func PrintTable(config *clientcmdapi.Config) error {
if obj.Namespace != "" {
namespace = obj.Namespace
}
server := config.Clusters[obj.Cluster].Server
conTmp := []string{head, key, obj.Cluster, obj.AuthInfo, server, namespace}
if config.Clusters == nil {
continue
}
cluster, ok := config.Clusters[obj.Cluster]
if !ok {
continue
}
conTmp := []string{head, key, obj.Cluster, obj.AuthInfo, cluster.Server, namespace}
table = append(table, conTmp)
}

Expand Down

0 comments on commit 25a00c0

Please sign in to comment.