Skip to content

Commit 7330f87

Browse files
committed
fixup: check len() first before calling function
Signed-off-by: Florian Lehner <[email protected]>
1 parent 18191d7 commit 7330f87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apmproxy/apmserver.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ func (c *Client) ForwardApmData(ctx context.Context) error {
6161
c.logger.Debug("Invocation context cancelled, not processing any more agent data")
6262
return nil
6363
case data := <-c.AgentDataChannel:
64+
if len(data.Data) == 0 {
65+
c.logger.Debugf("Received something from '%s' without APMData", data.AgentInfo)
66+
continue
67+
}
6468
if err := c.forwardAgentData(ctx, data); err != nil {
65-
if errors.Is(err, accumulator.ErrNoData) {
66-
c.logger.Debugf("Received something from '%s' without APMData", data.AgentInfo)
67-
continue
68-
}
6969
return err
7070
}
7171
once.Do(func() {

0 commit comments

Comments
 (0)