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 committed May 6, 2024
1 parent 16e9fc0 commit a2c522d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/iac/rego/load.go
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 a2c522d

Please sign in to comment.