From ccda3995e0b4926c34c9f388800c768427cab471 Mon Sep 17 00:00:00 2001 From: Alfredo Oliviero Date: Fri, 23 Feb 2024 12:28:37 +0100 Subject: [PATCH] manager checks for null secret before logging --- .../helloworld/manager/HelloWorldManager.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/service/helloworld/manager/HelloWorldManager.java b/src/main/java/org/gcube/service/helloworld/manager/HelloWorldManager.java index 957d412..96ca3f8 100644 --- a/src/main/java/org/gcube/service/helloworld/manager/HelloWorldManager.java +++ b/src/main/java/org/gcube/service/helloworld/manager/HelloWorldManager.java @@ -30,9 +30,12 @@ public class HelloWorldManager implements ApplicationManager { logger.debug("init called in offline mode"); } else { Secret secret = SecretManagerProvider.get(); - logger.debug("init called in context {}", secret.getContext()); + if (secret != null) { + logger.debug("init called in context {}", secret.getContext()); + } else { + logger.debug("init called in null context"); + } } - } @Override @@ -41,8 +44,11 @@ public class HelloWorldManager implements ApplicationManager { logger.debug("shutDown called in offline mode"); } else { Secret secret = SecretManagerProvider.get(); - logger.debug("shutDown called in context {}", secret.getContext()); + if (secret != null) { + logger.debug("shutDown called in context {}", secret.getContext()); + } else { + logger.debug("shutDown called in null context"); + } } } - }