This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 3_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 656ae60d2b7c88233519003c9ececb8367fc11bc
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Tue Dec 31 09:48:50 2024 +0100

    [SYNCOPE-1849] More robust reading of git info from actuator
---
 .../java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java
 
b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java
index ebb3ed77db..6e8d75896c 100644
--- 
a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java
+++ 
b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java
@@ -74,7 +74,9 @@ public class SyncopeAnonymousClient extends SyncopeClient {
         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);

Reply via email to