Skip to content

Commit

Permalink
fix: panic on nil ptr dereference when s3 backend not set
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Sep 17, 2024
1 parent b141432 commit d8c605b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/load_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// populateTargets ... creates a list of storage backends based on the provided target strings
func populateTargets(targets []string, s3 *store.S3Store, redis *store.RedStore) []store.PrecomputedKeyStore {
func populateTargets(targets []string, s3 store.PrecomputedKeyStore, redis *store.RedStore) []store.PrecomputedKeyStore {
stores := make([]store.PrecomputedKeyStore, len(targets))

for i, f := range targets {
Expand Down Expand Up @@ -42,7 +42,7 @@ func populateTargets(targets []string, s3 *store.S3Store, redis *store.RedStore)
func LoadStoreRouter(ctx context.Context, cfg CLIConfig, log log.Logger) (store.IRouter, error) {
// create S3 backend store (if enabled)
var err error
var s3 *store.S3Store
var s3 store.PrecomputedKeyStore
var redis *store.RedStore

if cfg.S3Config.Bucket != "" && cfg.S3Config.Endpoint != "" {
Expand Down

0 comments on commit d8c605b

Please sign in to comment.