Skip to content

Commit

Permalink
Prevent potential NPE while closing resource
Browse files Browse the repository at this point in the history
This prevents the `java.lang.NullPointerException: Cannot invoke "io.quarkus.bootstrap.runner.JarFileReference.close(io.quarkus.bootstrap.runner.JarResource)" because "ref" is null` error
  • Loading branch information
gastaldi committed Jul 19, 2024
1 parent 65b9c8d commit bc1a361
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 bc1a361

Please sign in to comment.