Skip to content

Commit

Permalink
Ensure k.slogger and k.systemSlogger are never nil
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Feb 22, 2024
1 parent d3beb3e commit 5eb8b31
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ee/agent/knapsack/knapsack.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ type knapsack struct {
}

func New(stores map[storage.Store]types.KVStore, flags types.Flags, db *bbolt.DB, slogger, systemSlogger *multislogger.MultiSlogger) *knapsack {
if slogger == nil {
slogger = multislogger.New()
}
if systemSlogger == nil {
slogger = multislogger.New()
}

k := &knapsack{
db: db,
flags: flags,
Expand Down

0 comments on commit 5eb8b31

Please sign in to comment.