You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2024/12/31 13:59:53 UTC

(syncope) 01/02: [SYNCOPE-1849] More robust reading of git info from actuator

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ò <il...@apache.org>
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);