From a3da60d1143d9c7638dd5f9398ac34bd530d713f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 18 Feb 2022 19:54:25 +0100 Subject: [PATCH] fix nil pointer dereference in bridge result Signed-off-by: CrazyMax --- solver/llbsolver/bridge.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/solver/llbsolver/bridge.go b/solver/llbsolver/bridge.go index 8ba91dd4..7cba1a5b 100644 --- a/solver/llbsolver/bridge.go +++ b/solver/llbsolver/bridge.go @@ -165,15 +165,15 @@ func (b *llbBridge) Solve(ctx context.Context, req frontend.SolveRequest, sid st if len(res.Refs) > 0 { for p := range res.Refs { - dtbi, errm := buildinfo.GetMetadata(res.Metadata, fmt.Sprintf("%s/%s", exptypes.ExporterBuildInfo, p), req.Frontend, req.FrontendOpt) - if errm != nil { + dtbi, err := buildinfo.GetMetadata(res.Metadata, fmt.Sprintf("%s/%s", exptypes.ExporterBuildInfo, p), req.Frontend, req.FrontendOpt) + if err != nil { return nil, err } res.Metadata[fmt.Sprintf("%s/%s", exptypes.ExporterBuildInfo, p)] = dtbi } } else { - dtbi, errm := buildinfo.GetMetadata(res.Metadata, exptypes.ExporterBuildInfo, req.Frontend, req.FrontendOpt) - if errm != nil { + dtbi, err := buildinfo.GetMetadata(res.Metadata, exptypes.ExporterBuildInfo, req.Frontend, req.FrontendOpt) + if err != nil { return nil, err } res.Metadata[exptypes.ExporterBuildInfo] = dtbi