Skip to content

Commit

Permalink
removed panic and added log statement
Browse files Browse the repository at this point in the history
not sure how this is triggered, but will help diagnose it in the future.

Signed-off-by: quobix <dave@quobix.com>
  • Loading branch information
daveshanley committed Feb 29, 2024
1 parent 4bacaf7 commit 7fa3c3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion motor/rule_applicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,11 @@ func removeDuplicates(results *[]model.RuleFunctionResult, rse *RuleSetExecution
stopNowPlease:
for _, line := range r {
if result.StartNode == nil {
panic("wtf")
if idx.GetLogger() != nil {
idx.GetLogger().Error("[rule-applicator] start node is nil, no line numbers available", "rule", result.RuleId,
"message", result.Message)
}
continue
}

if line.location == fmt.Sprintf("%d:%d", result.StartNode.Line, result.StartNode.Column) &&
Expand Down

0 comments on commit 7fa3c3e

Please sign in to comment.