Merge pull request #673 from tonistiigi/nil-value-check
solver: fix possible nil dereferencedocker-18.09
commit
8c8792b234
|
@ -211,7 +211,8 @@ func (ei *edgeIndex) getAllMatches(k *CacheKey) []string {
|
|||
for _, d := range dd {
|
||||
ll := CacheInfoLink{Input: Index(i), Digest: k.Digest(), Output: k.Output(), Selector: d.Selector}
|
||||
for _, ckID := range d.CacheKey.CacheKey.indexIDs {
|
||||
if l, ok := ei.items[ckID].links[ll]; ok {
|
||||
if item, ok := ei.items[ckID]; ok {
|
||||
if l, ok := item.links[ll]; ok {
|
||||
if _, ok := l[m]; ok {
|
||||
found = true
|
||||
break
|
||||
|
@ -219,6 +220,7 @@ func (ei *edgeIndex) getAllMatches(k *CacheKey) []string {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !found {
|
||||
delete(matches, m)
|
||||
|
|
Loading…
Reference in New Issue