Skip to content

Commit

Permalink
🐛 ensure we do not match on an empty variant mrn/uid when compiling b…
Browse files Browse the repository at this point in the history
…undles (#647)
  • Loading branch information
vjeffrey authored Jul 10, 2023
1 parent 5b53c00 commit 224f716
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion policy/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@ func (p *Bundle) Compile(ctx context.Context, library Library) (*PolicyBundleMap
ref := query.Variants[i]

for _, variant := range p.Queries {
if variant.Uid == ref.Uid || variant.Mrn == ref.Mrn {
if (variant.Uid != "" && variant.Uid == ref.Uid) ||
(variant.Mrn != "" && variant.Mrn == ref.Mrn) {
addBaseToVariant(query, variant)
}
}
Expand Down

0 comments on commit 224f716

Please sign in to comment.