Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu committed Dec 16, 2024
1 parent 212b66e commit 9224a6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/tools/buffer/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,22 +367,22 @@ func (r *Buffer) DataSize() int64 {
}

func (r *Buffer) FirstSocketBuffer() SocketDataBuffer {
if r.dataEvents == nil || r.dataEvents.Len() == 0 {
if r == nil || r.dataEvents == nil || r.dataEvents.Len() == 0 {
return nil
}
return r.dataEvents.Front().Value.(SocketDataBuffer)
}

func (r *Buffer) LastSocketBuffer() SocketDataBuffer {
if r.dataEvents == nil || r.dataEvents.Len() == 0 {
if r == nil || r.dataEvents == nil || r.dataEvents.Len() == 0 {
return nil
}
return r.dataEvents.Back().Value.(SocketDataBuffer)
}

// DetectNotSendingLastPosition detect the buffer contains not sending data: the BPF limited socket data count
func (r *Buffer) DetectNotSendingLastPosition() *Position {
if r.dataEvents.Len() == 0 {
if r == nil || r.dataEvents.Len() == 0 {
return nil
}

Expand Down

0 comments on commit 9224a6a

Please sign in to comment.