scheduler_perf: fix the nil pointer dereference

Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
Dave Chen 2020-06-16 13:23:05 +08:00
parent 1c11ff7a26
commit ae735a1189

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