Merge pull request #555 from ijc/exporter-panic

solver: avoid dereferencing nil res.Metadata
docker-18.09
Tõnis Tiigi 2018-08-03 13:15:52 -07:00 committed by GitHub
commit 7e98ece83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -105,6 +105,9 @@ func (s *Solver) Solve(ctx context.Context, id string, req frontend.SolveRequest
inp := exporter.Source{
Metadata: res.Metadata,
}
if inp.Metadata == nil {
inp.Metadata = make(map[string][]byte)
}
if res := res.Ref; res != nil {
workerRef, ok := res.Sys().(*worker.WorkerRef)
if !ok {