diff --git a/src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java b/src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java index 96bec2bc03..b3644e6c4d 100644 --- a/src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java +++ b/src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java @@ -132,7 +132,7 @@ void updateAdminPassword() { // Read custom password from environment variable String initialAdminPassword = System.getenv().get(ConfigConstants.OPENSEARCH_INITIAL_ADMIN_PASSWORD); - if (initialAdminPassword != null && !initialAdminPassword.isEmpty()) { + if (!Strings.isNullOrEmpty(initialAdminPassword)) { ADMIN_PASSWORD = initialAdminPassword; }