From e6e7a35a8eb7a73b9262deee870db12514aeb2e8 Mon Sep 17 00:00:00 2001 From: MohammadReza Palide Date: Wed, 10 Nov 2021 22:28:16 +0330 Subject: [PATCH] fix panic on empty result on GetBulk --- pkg/visor/api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/visor/api.go b/pkg/visor/api.go index 4b2b653193..6ae3dc88b5 100644 --- a/pkg/visor/api.go +++ b/pkg/visor/api.go @@ -217,7 +217,9 @@ func (v *Visor) Summary() (*Summary, error) { dmsgStatValue := &dmsgtracker.DmsgClientSummary{} if v.trackers != nil { - dmsgStatValue = &v.trackers.GetBulk([]cipher.PubKey{v.conf.PK})[0] + if dmsgTracker := v.trackers.GetBulk([]cipher.PubKey{v.conf.PK}); len(dmsgTracker) > 0 { + dmsgStatValue = &dmsgTracker[0] + } } summary := &Summary{