Skip to content

Commit

Permalink
Add quick nil check in TenantLimits for runtime_config (#4531)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanRushing authored Oct 22, 2021
1 parent 9e92528 commit 93507a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/loki/runtime_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ func (t *tenantLimitsFromRuntimeConfig) AllByUserID() map[string]*validation.Lim
}

func (t *tenantLimitsFromRuntimeConfig) TenantLimits(userID string) *validation.Limits {
return t.AllByUserID()[userID]
allByUserID := t.AllByUserID()
if allByUserID == nil {
return nil
}

return allByUserID[userID]
}

func newtenantLimitsFromRuntimeConfig(c *runtimeconfig.Manager) validation.TenantLimits {
Expand Down

0 comments on commit 93507a0

Please sign in to comment.