don't run os feature collector if metric not initialized

This commit is contained in:
Karan Goel
2021-01-13 09:33:13 -08:00
parent 71098097c0
commit f13d2a5449

View File

@@ -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()