Skip to content

Commit

Permalink
fix(misconf): skip Rego errors with a nil location (#6638)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikpivkin authored and knqyf263 committed May 20, 2024
1 parent c2b46d3 commit 8c27430
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/iac/rego/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ func (s *Scanner) fallbackChecks(compiler *ast.Compiler) {
var excludedFiles []string

for _, e := range compiler.Errors {
if e.Location == nil {
continue
}

loc := e.Location.File

if lo.Contains(excludedFiles, loc) {
Expand Down

0 comments on commit 8c27430

Please sign in to comment.