From f1c1a13ce21ab64093400ab7051f9857b5f601c0 Mon Sep 17 00:00:00 2001 From: Calvin Leung Huang Date: Wed, 6 Nov 2019 13:36:38 -0800 Subject: [PATCH] debug: check for nil secret on replication status response before accessing secret.Data (#7811) --- command/debug.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/debug.go b/command/debug.go index aa2fc1d48b7f..3fd54ea4f99e 100644 --- a/command/debug.go +++ b/command/debug.go @@ -814,7 +814,8 @@ func (c *DebugCommand) collectReplicationStatus(ctx context.Context) { if err != nil { c.captureError("replication-status", err) } - if replicationEntry := secret.Data; replicationEntry != nil { + if secret != nil && secret.Data != nil { + replicationEntry := secret.Data replicationEntry["timestamp"] = time.Now().UTC() c.replicationStatusCollection = append(c.replicationStatusCollection, replicationEntry) }