From b411406c2bfc2c59f1d95579089ad5508b6c474c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 15 Jun 2020 23:24:42 +0000 Subject: [PATCH] Added Check at line 189 to avoid crash --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 16a096d..2836013 100644 --- a/main.go +++ b/main.go @@ -186,6 +186,10 @@ func (e *Exporter) collect() error { }() for tf := range results { + if len(tf.Hosts) < 1 { + log.Infoln("no hosts reporting") + continue + } route := make([]net.IP, len(tf.Hosts)) destination := tf.Hosts[len(tf.Hosts)-1].IP for i, host := range tf.Hosts {