Allow creation of SpringProfileArbiter without Environment

See gh-39403
This commit is contained in:
Tim Grohmann 2024-02-05 14:51:22 +01:00 committed by Moritz Halbritter
parent 468c7e5c73
commit bd6edeaa94

View File

@ -95,8 +95,7 @@ final class SpringProfileArbiter implements Arbiter {
public SpringProfileArbiter build() {
Environment environment = Log4J2LoggingSystem.getEnvironment(this.loggerContext);
if (environment == null) {
statusLogger.warn("Cannot create Arbiter, no Spring Environment available");
return null;
statusLogger.debug("Creating Arbiter without a Spring Environment");
}
String name = this.configuration.getStrSubstitutor().replace(this.name);
String[] profiles = StringUtils.trimArrayElements(StringUtils.commaDelimitedListToStringArray(name));