Skip to content

Commit 723f8db

Browse files
authored
fixed empty pointer reference failure in agentctl report (#1941)
Signed-off-by: Filip Gschwandtner <[email protected]>
1 parent fce1eee commit 723f8db

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: cmd/agentctl/commands/report.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,12 @@ func writeVPPEventLogReport(w io.Writer, errorW io.Writer, cli agentcli.Cli, oth
672672
}
673673

674674
// get VPP startup time
675-
vppStartUpTime, err := vppStartupTime(*clockOutput)
676-
addRealTime := err == nil
675+
var vppStartUpTime *time.Time
676+
addRealTime := false
677+
if clockOutput != nil {
678+
vppStartUpTime, err = vppStartupTime(*clockOutput)
679+
addRealTime = err == nil
680+
}
677681

678682
// write event-log report (+ add into each line real date/time computed from VPP start timestamp)
679683
err = writeVPPCLICommandReport("Retrieving vpp event-log information",

0 commit comments

Comments
 (0)