From 5eb8b31edd8324dc7c883f276a6653291be66b3d Mon Sep 17 00:00:00 2001 From: Rebecca Mahany-Horton Date: Thu, 22 Feb 2024 15:00:42 -0500 Subject: [PATCH] Ensure k.slogger and k.systemSlogger are never nil --- ee/agent/knapsack/knapsack.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ee/agent/knapsack/knapsack.go b/ee/agent/knapsack/knapsack.go index 33b6163236..d6846f0dcb 100644 --- a/ee/agent/knapsack/knapsack.go +++ b/ee/agent/knapsack/knapsack.go @@ -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,