From af478e0e4514474c64d7b7e4dfdf520e1a376fdc Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 8 Dec 2018 00:42:13 -0600 Subject: [PATCH] fix very special case bug when trying to dhtPing the root via the admin api --- src/yggdrasil/admin.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/yggdrasil/admin.go b/src/yggdrasil/admin.go index ebd11d9c..7d82b135 100644 --- a/src/yggdrasil/admin.go +++ b/src/yggdrasil/admin.go @@ -739,6 +739,10 @@ func (a *admin) admin_dhtPing(keyString, coordString, targetString string) (dhtR } var coords []byte for _, cstr := range strings.Split(strings.Trim(coordString, "[]"), " ") { + if cstr == "" { + // Special case, happens if trimmed is the empty string, e.g. this is the root + continue + } if u64, err := strconv.ParseUint(cstr, 10, 8); err != nil { return dhtRes{}, err } else {