manager checks for null secret before logging

This commit is contained in:
Alfredo Oliviero 2024-02-23 12:28:37 +01:00
parent 535df5b3a9
commit ccda3995e0
1 changed files with 10 additions and 4 deletions

View File

@ -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");
}
}
}
}