Skip to content

Commit

Permalink
fix: index out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Apr 19, 2024
1 parent 48db570 commit ced60a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions promlinter.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ func (v *visitor) parseSendMetricChanExpr(chExpr *ast.SendStmt) ast.Visitor {
return v
}

if len(call.Args) == 0 {
return v
}

name, help := v.parseConstMetricOptsExpr(call.Args[0])
if name == nil {
return v
Expand Down

0 comments on commit ced60a7

Please sign in to comment.