provenance: add missing provenance check for typed nil

The previous check only checks for untyped nil, however, it's possible
for the provenance capture to be a typed nil as well, so we need to
check for this scenario as well.

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell
2022-12-12 14:26:48 +00:00
parent 31e692519c
commit 4e2f656ac4

View File

@@ -476,6 +476,10 @@ func getRefProvenance(ref solver.ResultProxy, br *provenanceBridge) (*provenance
}
if br.req != nil {
if pr == nil {
return nil, errors.Errorf("missing provenance for %s", ref.ID())
}
pr.Frontend = br.req.Frontend
pr.Args = provenance.FilterArgs(br.req.FrontendOpt)
// TODO: should also save some output options like compression