Skip to content

Commit ae735a1

Browse files
committed
scheduler_perf: fix the nil pointer dereference
Signed-off-by: Dave Chen <[email protected]>
1 parent 1c11ff7 commit ae735a1

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)