Skip to content

Commit

Permalink
fix: nil check for flushing
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 4a90356 commit 833ccf7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkg/agent/core/ngt/service/ngt.go
Original file line number Diff line number Diff line change
Expand Up @@ -1941,15 +1941,24 @@ func (n *ngt) gc() {
}

func (n *ngt) Len() uint64 {
return n.kvs.Len()
if n != nil && n.kvs != nil {
return n.kvs.Len()
}
return 0
}

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

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

func (n *ngt) GetDimensionSize() int {
Expand Down

0 comments on commit 833ccf7

Please sign in to comment.