debug: check for nil secret on replication status response before accessing secret.Data (#7811)

This commit is contained in:
Calvin Leung Huang 2019-11-06 13:36:38 -08:00 committed by Jeff Mitchell
parent 2bd068f0e5
commit 294005e6e1
1 changed files with 2 additions and 1 deletions

View File

@ -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)
}