Skip to content

Commit

Permalink
[FAB-8954] Fix index out of range panic
Browse files Browse the repository at this point in the history
Change-Id: I5186ce79d1648b0a6596824e80a13c9738f95df0
Signed-off-by: Bob Stasyszyn <[email protected]>
  • Loading branch information
bstasyszyn committed Mar 19, 2018
1 parent 6ab7137 commit 944cecc
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,14 @@ func (o *andOperation) and(grps []Group, index int) {
if index >= len(grps) {
var items []Item
for _, c := range o.stack.Groups() {
items = append(items, c.group.Items()[c.index])
groupItems := c.group.Items()
if c.index < len(groupItems) {
items = append(items, groupItems[c.index])
}
}
if len(items) > 0 {
o.result = append(o.result, NewGroup(items))
}
g := NewGroup(items)
o.result = append(o.result, g)
} else {
grp := grps[index]
items := grp.Items()
Expand Down

0 comments on commit 944cecc

Please sign in to comment.