Skip to content

Commit

Permalink
fix: Add protection against a possible null dereference issue (#1258)
Browse files Browse the repository at this point in the history
* Comment: Added protection against a possible null dereference issue.

* run linter

---------

Co-authored-by: Sydney Munro <[email protected]>
  • Loading branch information
munahaf and sydney-munro committed Oct 9, 2023
1 parent 3692fd0 commit ade173b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,10 @@ public ByteBuffer fetch(long position) throws InterruptedException, ExecutionExc
nbMiss++;
ensureFetching(blockIndex);
candidate = fetching;
buf = candidate.getBuf();
full.add(candidate);
if (candidate != null) {
buf = candidate.getBuf();
full.add(candidate);
}
fetching = null;
ensureFetching(blockIndex + 1);
return buf;
Expand Down

0 comments on commit ade173b

Please sign in to comment.