Skip to content

Commit eb9d202

Browse files
authored
Guard against nil pointer dereference (elastic#8107)
* Add nil guard * Return if nil * Use the assert.CollectT object
1 parent 3a9373b commit eb9d202

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

testing/integration/beat_receivers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ func TestAgentMonitoring(t *testing.T) {
280280

281281
// we should have filebeatreceiver and metricbeatreceiver running
282282
otelCollectorStatus := status.Collector
283+
require.NotNil(collect, otelCollectorStatus)
283284
assert.Equal(collect, int(cproto.CollectorComponentStatus_StatusOK), otelCollectorStatus.Status)
284285
pipelineStatusMap := otelCollectorStatus.ComponentStatusMap
285286

0 commit comments

Comments
 (0)