Skip to content

Commit 517d7f3

Browse files
committed
fix: add early return to getIndividualEfficiencies for empty dashboards
1 parent 04b67b9 commit 517d7f3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backend/pkg/api/data_access/mobile.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,9 @@ func (d *DataAccessService) GetValidatorDashboardMobileValidators(ctx context.Co
480480
}
481481

482482
func (d *DataAccessService) getIndividualEfficiencies(ctx context.Context, indices []uint64, table string) (map[uint64]float64, error) {
483+
if len(indices) == 0 {
484+
return map[uint64]float64{}, nil
485+
}
483486
ds := goqu.Dialect("postgres").
484487
From(goqu.L(fmt.Sprintf(`%s AS r FINAL`, table))).
485488
Select(

0 commit comments

Comments
 (0)