Skip to content

Commit

Permalink
Fix getRecursive for list of references
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelvenzi committed Aug 2, 2022
1 parent 4096d35 commit 093c5af
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion assets/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,26 @@ func getRecursive(stub *sw.StubWrapper, pvtCollection, key string, keysChecked [
return nil, errors.WrapErrorWithStatus(err, "failed to resolve asset references", 500)
}

keyIsFetchedInScope := false
for _, key := range keysCheckedInScope {
if key == elemKey.Key() {
keyIsFetchedInScope = true
break
}
}

keyIsFetched := false
for _, key := range keysChecked {
if key == elemKey.Key() {
keyIsFetched = true
break
}
}
if keyIsFetched {
if keyIsFetched && !keyIsFetchedInScope {
continue
}
keysChecked = append(keysChecked, elemKey.Key())
keysCheckedInScope = append(keysCheckedInScope, elemKey.Key())

var subAsset map[string]interface{}
if elemKey.IsPrivate() {
Expand Down

0 comments on commit 093c5af

Please sign in to comment.