From ebbbe8edcb207f75de92d54ae02f20fc81b1aec3 Mon Sep 17 00:00:00 2001 From: vishalnayak Date: Tue, 26 Jul 2016 15:30:38 -0400 Subject: [PATCH] Error out if cluster information is nil when Vault is unsealed --- http/sys_health.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/http/sys_health.go b/http/sys_health.go index 4f3182bb26..338392d4a5 100644 --- a/http/sys_health.go +++ b/http/sys_health.go @@ -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