Skip to content

Commit

Permalink
MB-57871: One more nil check before dereferencing postings (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavdangeti authored Oct 16, 2024
1 parent bf971e6 commit 7bab2f9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions faiss_vector_posting.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,15 @@ func (p *VecPostingsList) Size() int {
}

func (p *VecPostingsList) Count() uint64 {
n := p.postings.GetCardinality()
var e uint64
if p.except != nil {
e = p.postings.AndCardinality(p.except)
if p.postings != nil {
n := p.postings.GetCardinality()
var e uint64
if p.except != nil {
e = p.postings.AndCardinality(p.except)
}
return n - e
}
return n - e
return 0
}

func (vpl *VecPostingsList) ResetBytesRead(val uint64) {
Expand Down

0 comments on commit 7bab2f9

Please sign in to comment.