mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21:18:58 +00:00
(index-reader) Correctly handle negative offset values
When wordOffset(...) returns a negative value, it means the word isn't present in the index, and we should abort.
This commit is contained in:
parent
12590d3449
commit
9881cac2da
@ -81,6 +81,9 @@ public class PrioReverseIndexReader {
|
||||
|
||||
long offset = wordOffset(termId);
|
||||
|
||||
if (offset < 0) // No documents
|
||||
return 0;
|
||||
|
||||
ByteBuffer buffer = ByteBuffer.allocate(4);
|
||||
try {
|
||||
documentsChannel.read(buffer, offset);
|
||||
|
Loading…
Reference in New Issue
Block a user