Merge pull request #92169 from chendave/perf_nil_pointer

scheduler_perf: fix the nil pointer dereference
This commit is contained in:
Kubernetes Prow Robot 2020-06-16 10:06:04 -07:00 committed by GitHub
commit 13f1d956ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,10 @@ func collectHistogram(metric string, labels map[string]string) *DataItem {
klog.Error(err)
return nil
}
if hist.Histogram == nil {
klog.Errorf("metric %q is not a Histogram metric", metric)
return nil
}
if err := hist.Validate(); err != nil {
klog.Error(err)
return nil