Skip to content

Commit

Permalink
[SYNCOPE-1849] More robust reading of git info from actuator
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Dec 31, 2024
1 parent 7f625ee commit 656ae60
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public Pair<String, String> gitAndBuildInfo() {
try {
JsonNode info = info();
return Pair.of(
info.has("git") ? info.get("git").get("commit").get("id").asText() : StringUtils.EMPTY,
info.has("git") && info.get("git").has("commit") && info.get("git").get("commit").has("id")
? info.get("git").get("commit").get("id").asText()
: StringUtils.EMPTY,
info.get("build").get("version").asText());
} catch (IOException e) {
throw new RuntimeException("While getting build and git Info", e);
Expand Down

0 comments on commit 656ae60

Please sign in to comment.