Skip to content

Commit

Permalink
fix panic on empty result on GetBulk
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpalide committed Nov 10, 2021
1 parent de04612 commit e6e7a35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/visor/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit e6e7a35

Please sign in to comment.