Skip to content

Commit

Permalink
Merge pull request #42007 from gastaldi/npe
Browse files Browse the repository at this point in the history
Prevents potential NPE while closing resource
  • Loading branch information
gsmet authored Jul 22, 2024
2 parents 79be219 + bc1a361 commit 795a4b1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ public void close() {
// The jarfile has been already used and it's going to be removed from the cache,
// so the future must be already completed
var ref = futureRef.getNow(null);
assert (ref != null);
ref.close(this);
if (ref != null) {
ref.close(this);
}
}
}

Expand Down

0 comments on commit 795a4b1

Please sign in to comment.