Skip to content

Commit 13f1d95

Browse files
authored
Merge pull request kubernetes#92169 from chendave/perf_nil_pointer
scheduler_perf: fix the nil pointer dereference
2 parents 0a1e589 + ae735a1 commit 13f1d95

File tree

1 file changed

+4
-1
lines changed
  • test/integration/scheduler_perf

1 file changed

+4
-1
lines changed

test/integration/scheduler_perf/util.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ func collectHistogram(metric string, labels map[string]string) *DataItem {
179179
klog.Error(err)
180180
return nil
181181
}
182-
182+
if hist.Histogram == nil {
183+
klog.Errorf("metric %q is not a Histogram metric", metric)
184+
return nil
185+
}
183186
if err := hist.Validate(); err != nil {
184187
klog.Error(err)
185188
return nil

0 commit comments

Comments
 (0)