Skip to content

Commit f13d2a5

Browse files
committed
don't run os feature collector if metric not initialized
1 parent 7109809 commit f13d2a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/systemstatsmonitor/osfeature_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (ofc *osFeatureCollector) recordFeaturesFromModules(modules []system.Module
142142
}
143143

144144
func (ofc *osFeatureCollector) collect() {
145-
if ofc.osFeature == nil {
145+
if ofc == nil || ofc.osFeature == nil {
146146
return
147147
}
148148
cmdlineArgs, err := system.CmdlineArgs()

0 commit comments

Comments
 (0)