Skip to content
Snippets Groups Projects
Unverified Commit 73635c08 authored by Jess's avatar Jess Committed by GitHub
Browse files

Merge pull request #132 from hausdorff/nil

Fix `nil` dereference error in #129
parents c5dd1a77 7cd60cc1
No related branches found
No related tags found
No related merge requests found
......@@ -157,7 +157,10 @@ func resolveContext(context *string) (server, namespace string, err error) {
}
log.Infof("Using context '%s'", ctxName)
cluster := rawConfig.Clusters[ctx.Cluster]
cluster, exists := rawConfig.Clusters[ctx.Cluster]
if !exists {
return "", "", fmt.Errorf("No cluster with name '%s' exists", ctx.Cluster)
}
return cluster.Server, ctx.Namespace, nil
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment