Skip to content

Commit

Permalink
Ensure HttpClient#reactorNettyVersion() does not throw NullPointExcep…
Browse files Browse the repository at this point in the history
…tion when loaded through java agent under JDK 1.8 (#3266)
  • Loading branch information
KyoUK4n authored and violetagg committed May 27, 2024
1 parent e5a3d34 commit 2222e08
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1596,9 +1596,11 @@ static boolean isCompressing(HttpHeaders h) {
}

static String reactorNettyVersion() {
return Optional.ofNullable(HttpClient.class.getPackage()
.getImplementationVersion())
.orElse("dev");
Package pac = HttpClient.class.getPackage();
if (pac == null) {
return "dev";
}
return Optional.ofNullable(pac.getImplementationVersion()).orElse("dev");
}

static final Logger log = Loggers.getLogger(HttpClient.class);
Expand Down

0 comments on commit 2222e08

Please sign in to comment.