mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 00:08:10 -05:00
StatsColelctor: Check if result is nil before set the metrics (#59372)
Check if result is nil before set the metrics
This commit is contained in:
@@ -321,6 +321,11 @@ func (s *Service) updateTotalStats(ctx context.Context) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if statsQuery.Result == nil {
|
||||
s.log.Error("Cannot retrieve system stats")
|
||||
return false
|
||||
}
|
||||
|
||||
metrics.MStatTotalDashboards.Set(float64(statsQuery.Result.Dashboards))
|
||||
metrics.MStatTotalFolders.Set(float64(statsQuery.Result.Folders))
|
||||
metrics.MStatTotalUsers.Set(float64(statsQuery.Result.Users))
|
||||
|
||||
Reference in New Issue
Block a user