Error out if cluster information is nil when Vault is unsealed

This commit is contained in:
vishalnayak
2016-07-26 15:30:38 -04:00
parent 70f73cf1cc
commit ebbbe8edcb

View File

@@ -123,10 +123,11 @@ func getSysHealth(core *vault.Core, r *http.Request) (int, *HealthResponse, erro
if err != nil {
return http.StatusInternalServerError, nil, err
}
if cluster != nil {
clusterName = cluster.Name
clusterID = cluster.ID
if cluster == nil {
return http.StatusInternalServerError, nil, nil
}
clusterName = cluster.Name
clusterID = cluster.ID
}
// Format the body