mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 03:34:15 -06: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:
parent
64143ea7d0
commit
92e3ee7d89
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user