Skip to content

Commit

Permalink
solver: protect against nil rres upon errors
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Couture-Beil <[email protected]>
  • Loading branch information
alexcb committed Oct 13, 2023
1 parent 4e6e35e commit 9a8bd9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion solver/cachemanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ func (c *cacheManager) Load(ctx context.Context, rec *CacheRecord) (rres Result,
"stack": bklog.TraceLevelOnlyStack(),
})
defer func() {
lg.WithError(rerr).WithField("return_result", rres.ID()).Trace("cache manager")
rresID := "<nil>"
if rres != nil {
rresID = rres.ID()
}
lg.WithError(rerr).WithField("return_result", rresID).Trace("cache manager")
}()

c.mu.RLock()
Expand Down

0 comments on commit 9a8bd9f

Please sign in to comment.