Skip to content

Commit

Permalink
fix: nil check bug
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Sep 9, 2024
1 parent 50861c7 commit f8b76c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/agent/core/ngt/service/ngt.go
Original file line number Diff line number Diff line change
Expand Up @@ -1948,14 +1948,14 @@ func (n *ngt) Len() uint64 {
}

func (n *ngt) InsertVQueueBufferLen() uint64 {
if n != nil && n.kvs != nil && !n.IsFlushing() {
if n != nil && n.vq != nil && !n.IsFlushing() {
return uint64(n.vq.IVQLen())
}
return 0

Check warning on line 1954 in pkg/agent/core/ngt/service/ngt.go

View check run for this annotation

Codecov / codecov/patch

pkg/agent/core/ngt/service/ngt.go#L1954

Added line #L1954 was not covered by tests
}

func (n *ngt) DeleteVQueueBufferLen() uint64 {
if n != nil && n.kvs != nil && !n.IsFlushing() {
if n != nil && n.vq != nil && !n.IsFlushing() {
return uint64(n.vq.DVQLen())
}
return 0

Check warning on line 1961 in pkg/agent/core/ngt/service/ngt.go

View check run for this annotation

Codecov / codecov/patch

pkg/agent/core/ngt/service/ngt.go#L1961

Added line #L1961 was not covered by tests
Expand Down

0 comments on commit f8b76c6

Please sign in to comment.