From 8a88a863fa0658f45d3ffae2f1b5ed29f5952d51 Mon Sep 17 00:00:00 2001 From: Filip Gschwandtner Date: Fri, 6 Oct 2023 13:52:00 +0200 Subject: [PATCH] fixed empty pointer reference failure in agentctl report Signed-off-by: Filip Gschwandtner --- cmd/agentctl/commands/report.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/agentctl/commands/report.go b/cmd/agentctl/commands/report.go index 479ff0618..222b12fe8 100644 --- a/cmd/agentctl/commands/report.go +++ b/cmd/agentctl/commands/report.go @@ -672,8 +672,12 @@ func writeVPPEventLogReport(w io.Writer, errorW io.Writer, cli agentcli.Cli, oth } // get VPP startup time - vppStartUpTime, err := vppStartupTime(*clockOutput) - addRealTime := err == nil + var vppStartUpTime *time.Time + addRealTime := false + if clockOutput != nil { + vppStartUpTime, err = vppStartupTime(*clockOutput) + addRealTime = err == nil + } // write event-log report (+ add into each line real date/time computed from VPP start timestamp) err = writeVPPCLICommandReport("Retrieving vpp event-log information",