From 68c84488aeed38b4c191417a38ac399c44837e71 Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 23 Jan 2023 20:55:31 +0800 Subject: [PATCH] fix a bug caused table crash when using IPv6 --- trace/icmp_ipv6.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trace/icmp_ipv6.go b/trace/icmp_ipv6.go index ebe1e2f..f6bfad3 100644 --- a/trace/icmp_ipv6.go +++ b/trace/icmp_ipv6.go @@ -110,7 +110,9 @@ func (t *ICMPTracerv6) Execute() (*Result, error) { t.wg.Wait() t.res.reduce(t.final) if t.final != -1 { - t.RealtimePrinter(&t.res, t.final-1) + if t.RealtimePrinter != nil { + t.RealtimePrinter(&t.res, t.final-1) + } } else { for i := 0; i < t.NumMeasurements; i++ { t.res.add(Hop{