From f13d2a54491b2ae29356cfa05d7e10bb489b9ec9 Mon Sep 17 00:00:00 2001 From: Karan Goel Date: Wed, 13 Jan 2021 09:33:13 -0800 Subject: [PATCH] don't run os feature collector if metric not initialized --- pkg/systemstatsmonitor/osfeature_collector.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/systemstatsmonitor/osfeature_collector.go b/pkg/systemstatsmonitor/osfeature_collector.go index 1dd62c54..afff5fe9 100644 --- a/pkg/systemstatsmonitor/osfeature_collector.go +++ b/pkg/systemstatsmonitor/osfeature_collector.go @@ -142,7 +142,7 @@ func (ofc *osFeatureCollector) recordFeaturesFromModules(modules []system.Module } func (ofc *osFeatureCollector) collect() { - if ofc.osFeature == nil { + if ofc == nil || ofc.osFeature == nil { return } cmdlineArgs, err := system.CmdlineArgs()