Skip to content

Commit c027c2c

Browse files
authored
fix: possible nil deref in admin_info
1 parent 31a5d64 commit c027c2c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

api/admin_info.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,14 +1121,15 @@ LabelsWaitLoop:
11211121
if inStep != nil && *inStep > 0 {
11221122
step = *inStep
11231123
}
1124+
1125+
if inStart != nil && inEnd != nil {
1126+
extraParamters = fmt.Sprintf("&start=%d&end=%d", *inStart, *inEnd)
1127+
}
1128+
11241129
if step > 0 {
11251130
extraParamters = fmt.Sprintf("%s&step=%d", extraParamters, step)
11261131
}
11271132

1128-
if inStart != nil && inEnd != nil {
1129-
extraParamters = fmt.Sprintf("&start=%d&end=%d&step=%d", *inStart, *inEnd, *inStep)
1130-
}
1131-
11321133
// replace the `$__rate_interval` global for step with unit (s for seconds)
11331134
queryExpr := strings.ReplaceAll(target.Expr, "$__rate_interval", fmt.Sprintf("%ds", 240))
11341135
if strings.Contains(queryExpr, "$") {

0 commit comments

Comments
 (0)