Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 406f79d

Browse files
Firas QutishatGerrit Code Review
authored andcommitted
Merge "[FAB-8954] Fix index out of range panic"
2 parents df35f4f + 944cecc commit 406f79d

File tree

1 file changed

+7
-3
lines changed
  • pkg/client/common/selection/dynamicselection/pgresolver

1 file changed

+7
-3
lines changed

pkg/client/common/selection/dynamicselection/pgresolver/groupsimpl.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,14 @@ func (o *andOperation) and(grps []Group, index int) {
378378
if index >= len(grps) {
379379
var items []Item
380380
for _, c := range o.stack.Groups() {
381-
items = append(items, c.group.Items()[c.index])
381+
groupItems := c.group.Items()
382+
if c.index < len(groupItems) {
383+
items = append(items, groupItems[c.index])
384+
}
385+
}
386+
if len(items) > 0 {
387+
o.result = append(o.result, NewGroup(items))
382388
}
383-
g := NewGroup(items)
384-
o.result = append(o.result, g)
385389
} else {
386390
grp := grps[index]
387391
items := grp.Items()

0 commit comments

Comments
 (0)